Merging the UTF8 patch, consisting of O'ksi'd s original 1.1.6 patch and additions by Ian. PLEASE BE AWARE that the patch in its current incarnation is a regression in many aspects and further work is required before we can announce Unicode support.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6212 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
This commit is contained in:
Matthias Melcher 2008-09-10 23:56:49 +00:00
parent dfb50e8529
commit b6bde2e456
238 changed files with 36617 additions and 987 deletions

View File

@ -28,6 +28,7 @@
#ifndef Fl_H
# define Fl_H
# include "fl_utf8.H"
# include "Enumerations.H"
# ifndef Fl_Object
# define Fl_Object Fl_Widget

View File

@ -34,6 +34,7 @@ class FL_EXPORT Fl_Input : public Fl_Input_ {
int handle_key();
int shift_position(int p);
int shift_up_down_position(int p);
void handle_mouse(int keepmark=0);
public:
void draw();
int handle(int);

View File

@ -148,11 +148,12 @@ inline int fl_height(int, int size) {return size;}
FL_EXPORT int fl_descent();
FL_EXPORT double fl_width(const char*);
FL_EXPORT double fl_width(const char*, int n);
FL_EXPORT double fl_width(uchar);
FL_EXPORT double fl_width(Fl_Char);
// draw using current font:
FL_EXPORT void fl_draw(const char*, int x, int y);
FL_EXPORT void fl_draw(const char*, int n, int x, int y);
FL_EXPORT void fl_rtl_draw(const char*, int n, int x, int y);
FL_EXPORT void fl_measure(const char*, int& x, int& y, int draw_symbols = 1);
FL_EXPORT void fl_draw(const char*, int,int,int,int, Fl_Align, Fl_Image* img=0,
int draw_symbols = 1);
@ -195,6 +196,16 @@ FL_EXPORT const char* fl_shortcut_label(int);
FL_EXPORT void fl_overlay_rect(int,int,int,int);
FL_EXPORT void fl_overlay_clear();
FL_EXPORT void fl_cursor(Fl_Cursor, Fl_Color=FL_BLACK, Fl_Color=FL_WHITE);
FL_EXPORT const char* fl_expand_text(const char* from, char* buf, int maxbuf,
double maxw, int& n, double &width,
int wrap, int draw_symbols = 0);
// XIM:
FL_EXPORT void fl_set_status(int X, int Y, int W, int H);
FL_EXPORT void fl_set_spot(int font, int size, int x, int y, int w, int h);
FL_EXPORT void fl_reset_spot(void);
// XForms symbols:
FL_EXPORT int fl_draw_symbol(const char* label,int x,int y,int w,int h, Fl_Color);

View File

@ -208,8 +208,10 @@ inline void fl_reset_focus_object(Fl_Widget* o) {Fl::focus(o);}
inline void fl_set_object_boxtype(Fl_Widget* o, Fl_Boxtype a) {o->box(a);}
inline void fl_set_object_lsize(Fl_Widget* o,int s) {o->labelsize(s);}
/* forms lib font indexes must be byte sized - extract correct byte from style word */
inline void fl_set_object_lstyle(Fl_Widget* o,int a) {
o->labelfont((Fl_Font)a); o->labeltype((Fl_Labeltype)(a>>8));}
o->labelfont((Fl_Font)(a&0xff)); o->labeltype((Fl_Labeltype)(a>>8));}
inline void fl_set_object_lcol(Fl_Widget* o, unsigned a) {o->labelcolor(a);}
#define fl_set_object_lcolor fl_set_object_lcol
inline void fl_set_object_lalign(Fl_Widget* o, Fl_Align a) {o->align(a);}
@ -662,7 +664,7 @@ FL_EXPORT int fl_show_choice(
const char *b1,
const char *b2);
inline void fl_set_goodies_font(uchar a, uchar b) {fl_message_font(a,b);}
inline void fl_set_goodies_font(Fl_Font a, Fl_Fontsize b) {fl_message_font(a,b);}
#define fl_show_messages fl_message
inline int fl_show_choices(const char* c,int n,const char* b1,const char* b2,
const char* b3, int) {

View File

@ -407,7 +407,7 @@ FL_EXPORT GLUTproc glutGetProcAddress(const char *procName);
//inline void glutVideoPan(int x, int y, int width, int height);
// Font argument must be a void* for compatability, so...
extern FL_EXPORT struct Fl_Glut_Bitmap_Font {uchar font; int size;}
extern FL_EXPORT struct Fl_Glut_Bitmap_Font {Fl_Font font; Fl_Fontsize size;}
glutBitmap9By15, glutBitmap8By13, glutBitmapTimesRoman10,
glutBitmapTimesRoman24, glutBitmapHelvetica10, glutBitmapHelvetica12,
glutBitmapHelvetica18;

View File

@ -1,5 +1,5 @@
//
// "$Id:$"
// "$Id$"
//
// Event names header file for the Fast Light Tool Kit (FLTK).
//
@ -81,5 +81,5 @@ char *fl_fontnames[] =
#endif /* FL_NAMES_H */
//
// End of "$Id:$".
// End of "$Id$".
//

5
FL/x.H
View File

@ -50,7 +50,7 @@
# endif
# include <X11/Xatom.h>
# include "Fl_Window.H"
# include "Xutf8.h"
// Mirror X definition of Region to Fl_Region, for portability...
typedef Region Fl_Region;
@ -68,7 +68,8 @@ extern FL_EXPORT Colormap fl_colormap;
// drawing functions:
extern FL_EXPORT GC fl_gc;
extern FL_EXPORT Window fl_window;
extern FL_EXPORT XFontStruct* fl_xfont;
//extern FL_EXPORT XFontStruct* fl_xfont;
extern FL_EXPORT XUtf8FontStruct* fl_xfont;
extern FL_EXPORT void *fl_xftfont;
FL_EXPORT ulong fl_xpixel(Fl_Color i);
FL_EXPORT ulong fl_xpixel(uchar r, uchar g, uchar b);

95
README.fltk118-utf Normal file
View File

@ -0,0 +1,95 @@
NOTES:
------
This is a cut down snapshot of fltk-1.1.x-r6041 merged in a somewhat
haphazard manner with the OksiD UTF-8 patch (for fltk-1.1.6)
Then some of the UTF functions from FLTK2 were back-ported into the
mix.
This code has also been modified to implement the XFT support on X
that was missing from the fltk-1.1.6 variant.
I have also introduced a number of extra test programs into the "demo"
directory - to test DnD operation, and to verify the behaviour Fl::add_fd()
on various platforms (this test also verifies some aspects of UDP multicast
operation that was causing issues on win32 with winsock-1.1.)
These two examples are accessed from the Demo program in the Events submenu.
There is also an extended font-chooser/unicode font display test, derived
from the utf8 test that OksiD had added to fltk-1.1.6-utf8.
This is accessed in the Demo program under the Other Tests/Font Tests
submenu.
This code has been tested on linux (FC7), WinXP with mingw
and OSX 10.4.11.
The OSX port MUST HAVE the QUARTZ mode enabled in configure to
work (the older fltk QD code will not work.)
Linux
-----
This code has been built with the following configure options
on the linux platform:
./configure --enable-threads --enable-xft
At present the code also works without XFT enabled (as the original OksiD
code did) but I can't count on that state of affairs being permanent!
./configure --enable-threads
WIN32
-----
On WinXP, the code was built with mingw in an Msys shell with the
following configure options:
./configure --enable-threads
Was used an a box that already has image libs installed.
./configure --enable-threads --enable-localjpeg --enable-localzlib --enable-localpng
Was used an a box that does not have image libs installed.
Both cases function as expected.
I do not have access to the MS compler tools here, so the code is untested with
their compilers. I do not think I have introduced any incompatabilities but...
Feedback welcome.
NOTE: The "standard" FLTK-1.1 build uses the (deprecated) winsock-1.1 libs.
This revised code uses the (allegedly) better winsock-2 libs instead.
This means you will probably have to change the link options in any existing
projects to incorporate this change - the libs are *NOT* reliably inter-changeable!
(fltk-utf8-config will return the correct libs for use.)
OSX
---
The OSX build was configured with:
./configure --enable-threads --enable-quartz
Issues
------
At time of writing, the code seems to "work", but there are issues:
- The build is "noisy".
- The gl font handling is not ideal under XFT (but it always was
anyway. We need a glXUseXftFont method really, but that doesn't seem
to exist...I could try and write one, but time...)
- The xim stuff is still needing work - I'm pretty sure I have broken this
- Input methods under win32? I don't know.
- Input Methods under OSX? No idea.
- The code is now badly formatted in places from all my random
cut'n'paste...
--
IMM: 24th Feb 2008

664
TODO.utf8 Normal file
View File

@ -0,0 +1,664 @@
ANNOUNCEMENT
CHANGES
CMake
CMakeLists.txt
COPYING
CREDITS
DartConfig.cmake
Doxyfile
FL
GL
Makefile
README
README.mac
README.win32
TODO.unicode
TODO.utf8
bc5
borlandc
configh.cmake.in
configh.in
configure.in
documentation
fltk-config.in
fltk.list.in
fltk.spec.in
fltk.xpm
fluid
forms.h
ide
install-sh
jpeg
lib
makefiles
makeinclude.in
makesrcdist
png
src
test
vc2005
vcnet
visualc
watcom
watcom.mif
xutf8
zlib
./CMake:
CheckFunctionWithHeaderExists.cmake
FLTKConfig.cmake.in
FLTKUse.cmake
PlatformTests.cxx
./FL:
Enumerations.H
Fl.H
Fl_Adjuster.H
Fl_BMP_Image.H
Fl_Bitmap.H
Fl_Box.H
Fl_Browser.H
Fl_Browser_.H
Fl_Button.H
Fl_Chart.H
Fl_Check_Browser.H
Fl_Check_Button.H
Fl_Choice.H
Fl_Clock.H
Fl_Color_Chooser.H
Fl_Counter.H
Fl_Dial.H
Fl_Double_Window.H
Fl_Export.H
Fl_File_Browser.H
Fl_File_Chooser.H
Fl_File_Icon.H
Fl_File_Input.H
Fl_Fill_Dial.H
Fl_Fill_Slider.H
Fl_Float_Input.H
Fl_FormsBitmap.H
Fl_FormsPixmap.H
Fl_Free.H
Fl_GIF_Image.H
Fl_Gl_Window.H
Fl_Group.H
Fl_Help_Dialog.H
Fl_Help_View.H
Fl_Hold_Browser.H
Fl_Hor_Fill_Slider.H
Fl_Hor_Nice_Slider.H
Fl_Hor_Slider.H
Fl_Hor_Value_Slider.H
Fl_Image.H
Fl_Input.H
Fl_Input_.H
Fl_Input_Choice.H
Fl_Int_Input.H
Fl_JPEG_Image.H
Fl_Light_Button.H
Fl_Line_Dial.H
Fl_Menu.H
Fl_Menu_.H
Fl_Menu_Bar.H
Fl_Menu_Button.H
Fl_Menu_Item.H
Fl_Menu_Window.H
Fl_Multi_Browser.H
Fl_Multi_Label.H
Fl_Multiline_Input.H
Fl_Multiline_Output.H
Fl_Nice_Slider.H
Fl_Object.H
Fl_Output.H
Fl_Overlay_Window.H
Fl_PNG_Image.H
Fl_PNM_Image.H
Fl_Pack.H
Fl_Pixmap.H
Fl_Positioner.H
Fl_Preferences.H
Fl_Progress.H
Fl_RGB_Image.H
Fl_Radio_Button.H
Fl_Radio_Light_Button.H
Fl_Radio_Round_Button.H
Fl_Repeat_Button.H
Fl_Return_Button.H
Fl_Roller.H
Fl_Round_Button.H
Fl_Round_Clock.H
Fl_Scroll.H
Fl_Scrollbar.H
Fl_Secret_Input.H
Fl_Select_Browser.H
Fl_Shared_Image.H
Fl_Simple_Counter.H
Fl_Single_Window.H
Fl_Slider.H
Fl_Spinner.H
Fl_Sys_Menu_Bar.H
Fl_Tabs.H
Fl_Text_Buffer.H
Fl_Text_Display.H
Fl_Text_Editor.H
Fl_Tile.H
Fl_Tiled_Image.H
Fl_Timer.H
Fl_Toggle_Button.H
Fl_Toggle_Light_Button.H
Fl_Toggle_Round_Button.H
Fl_Tooltip.H
Fl_Valuator.H
Fl_Value_Input.H
Fl_Value_Output.H
Fl_Value_Slider.H
Fl_Widget.H
Fl_Window.H
Fl_Wizard.H
Fl_XBM_Image.H
Fl_XPM_Image.H
Makefile.in
Xutf8.h
dirent.h
filename.H
fl_ask.H
fl_draw.H
fl_message.H
fl_show_colormap.H
fl_show_input.H
fl_utf8.H
forms.H
gl.h
gl2opengl.h
gl_draw.H
glu.h
glut.H
mac.H
math.h
names.h
win32.H
x.H
./GL:
glut.h
./fluid:
CMakeLists.txt
CodeEditor.cxx
CodeEditor.h
Fl_Function_Type.cxx
Fl_Group_Type.cxx
Fl_Menu_Type.cxx
Fl_Type.cxx
Fl_Type.h
Fl_Widget_Type.cxx
Fl_Widget_Type.h
Fl_Window_Type.cxx
Fluid_Image.cxx
Fluid_Image.h
Makefile
Shortcut_Button.h
about_panel.cxx
about_panel.fl
about_panel.h
align_widget.cxx
alignment_panel.cxx
alignment_panel.fl
alignment_panel.h
code.cxx
comments.h
factory.cxx
file.cxx
fluid.app
fluid.cxx
fluid.desktop
function_panel.cxx
function_panel.fl
function_panel.h
icons
makedepend
makefile.wat
pixmaps
print_panel.cxx
print_panel.fl
print_panel.h
template_panel.cxx
template_panel.fl
template_panel.h
undo.cxx
undo.h
widget_panel.cxx
widget_panel.fl
widget_panel.h
x-fluid.desktop
./ide/XCode3:
FLTK.xcodeproj
TODO
config.h
icons
plists
./ide/XCode3/FLTK.xcodeproj:
project.pbxproj
./makefiles:
Makefile.mingw
Makefile.os2x
config.mingw
config.os2x
makeinclude.mingw
makeinclude.mingw31
makeinclude.os2x
./src:
CMakeLists.txt
Fl.cxx
Fl_Adjuster.cxx
Fl_BMP_Image.cxx
Fl_Bitmap.cxx
Fl_Box.cxx
Fl_Browser.cxx
Fl_Browser_.cxx
Fl_Browser_load.cxx
Fl_Button.cxx
Fl_Chart.cxx
Fl_Check_Browser.cxx
Fl_Check_Button.cxx
Fl_Choice.cxx
Fl_Clock.cxx
Fl_Color_Chooser.cxx
Fl_Counter.cxx
Fl_Dial.cxx
Fl_Double_Window.cxx
Fl_File_Browser.cxx
Fl_File_Chooser.cxx
Fl_File_Chooser.fl
Fl_File_Chooser2.cxx
Fl_File_Icon.cxx
Fl_File_Icon2.cxx
Fl_File_Input.cxx
Fl_Font.H
Fl_GIF_Image.cxx
Fl_Gl_Choice.H
Fl_Gl_Choice.cxx
Fl_Gl_Overlay.cxx
Fl_Gl_Window.cxx
Fl_Group.cxx
Fl_Help_Dialog.cxx
Fl_Help_Dialog.fl
Fl_Help_View.cxx
Fl_Image.cxx
Fl_Input.cxx
Fl_Input_.cxx
Fl_JPEG_Image.cxx
Fl_Light_Button.cxx
Fl_Menu.cxx
Fl_Menu_.cxx
Fl_Menu_Bar.cxx
Fl_Menu_Button.cxx
Fl_Menu_Window.cxx
Fl_Menu_add.cxx
Fl_Menu_global.cxx
Fl_Multi_Label.cxx
Fl_Overlay_Window.cxx
Fl_PNG_Image.cxx
Fl_PNM_Image.cxx
Fl_Pack.cxx
Fl_Pixmap.cxx
Fl_Positioner.cxx
Fl_Preferences.cxx
Fl_Progress.cxx
Fl_Repeat_Button.cxx
Fl_Return_Button.cxx
Fl_Roller.cxx
Fl_Round_Button.cxx
Fl_Scroll.cxx
Fl_Scrollbar.cxx
Fl_Shared_Image.cxx
Fl_Single_Window.cxx
Fl_Slider.cxx
Fl_Sys_Menu_Bar.cxx
Fl_Tabs.cxx
Fl_Text_Buffer.cxx
Fl_Text_Display.cxx
Fl_Text_Editor.cxx
Fl_Tile.cxx
Fl_Tiled_Image.cxx
Fl_Tooltip.cxx
Fl_Valuator.cxx
Fl_Value_Input.cxx
Fl_Value_Output.cxx
Fl_Value_Slider.cxx
Fl_Widget.cxx
Fl_Window.cxx
Fl_Window_fullscreen.cxx
Fl_Window_hotspot.cxx
Fl_Window_iconize.cxx
Fl_Wizard.cxx
Fl_XBM_Image.cxx
Fl_XColor.H
Fl_XPM_Image.cxx
Fl_abort.cxx
Fl_add_idle.cxx
Fl_arg.cxx
Fl_compose.cxx
Fl_display.cxx
Fl_get_key.cxx
Fl_get_key_mac.cxx
Fl_get_key_win32.cxx
Fl_get_system_colors.cxx
Fl_grab.cxx
Fl_lock.cxx
Fl_mac.cxx
Fl_own_colormap.cxx
Fl_visual.cxx
Fl_win32.cxx
Fl_x.cxx
Makefile
aimm.h
allfiles.xbm
cgdebug.h
cmap.cxx
d1.xbm
d1_mask.xbm
dump_compose.c
ew.xbm
ew_mask.xbm
fastarrow.h
filename_absolute.cxx
filename_expand.cxx
filename_ext.cxx
filename_isdir.cxx
filename_list.cxx
filename_match.cxx
filename_setext.cxx
fl_arc.cxx
fl_arci.cxx
fl_ask.cxx
fl_boxtype.cxx
fl_call_main.c
fl_cmap.h
fl_color.cxx
fl_color_mac.cxx
fl_color_win32.cxx
fl_cursor.cxx
fl_curve.cxx
fl_diamond_box.cxx
fl_dnd.cxx
fl_dnd_mac.cxx
fl_dnd_win32.cxx
fl_dnd_x.cxx
fl_draw.cxx
fl_draw_image.cxx
fl_draw_image_mac.cxx
fl_draw_image_win32.cxx
fl_draw_pixmap.cxx
fl_encoding_latin1.cxx
fl_encoding_mac_roman.cxx
fl_engraved_label.cxx
fl_file_dir.cxx
fl_font.cxx
fl_font_mac.cxx
fl_font_win32.cxx
fl_font_x.cxx
fl_font_xft.cxx
fl_gtk.cxx
fl_images_core.cxx
fl_labeltype.cxx
fl_line_style.cxx
fl_open_uri.cxx
fl_oval_box.cxx
fl_overlay.cxx
fl_overlay_visual.cxx
fl_plastic.cxx
fl_read_image.cxx
fl_read_image_mac.cxx
fl_read_image_win32.cxx
fl_rect.cxx
fl_round_box.cxx
fl_rounded_box.cxx
fl_scroll_area.cxx
fl_set_font.cxx
fl_set_fonts.cxx
fl_set_fonts_mac.cxx
fl_set_fonts_win32.cxx
fl_set_fonts_x.cxx
fl_set_fonts_xft.cxx
fl_shadow_box.cxx
fl_shortcut.cxx
fl_show_colormap.cxx
fl_symbols.cxx
fl_utf.c
fl_utf8.cxx
fl_vertex.cxx
flstring.c
flstring.h
forms_bitmap.cxx
forms_compatability.cxx
forms_free.cxx
forms_fselect.cxx
forms_pixmap.cxx
forms_timer.cxx
freeglut_geometry.cxx
freeglut_stroke_mono_roman.cxx
freeglut_stroke_roman.cxx
freeglut_teapot.cxx
freeglut_teapot_data.h
gl_draw.cxx
gl_start.cxx
glut_compatability.cxx
glut_font.cxx
makedepend
makefile.wat
mediumarrow.h
new.xbm
ns.xbm
ns_mask.xbm
numericsort.c
scandir.c
scandir_win32.c
screen_xywh.cxx
slowarrow.h
tile.xpm
up.xbm
vsnprintf.c
./test:
CMakeLists.txt
CubeMain.cxx
CubeView.cxx
CubeView.h
CubeViewUI.fl
Makefile
README
adjuster.cxx
arc.cxx
ask.cxx
bitmap.cxx
blocks.app
blocks.cxx
boxtype.cxx
browser.cxx
button.cxx
buttons.cxx
checkers.app
checkers.cxx
clock.cxx
colbrowser.cxx
color_chooser.cxx
connect.cxx
cube.cxx
cursor.cxx
curve.cxx
demo.cxx
demo.menu
desktop
dnd-test.cxx
doublebuffer.cxx
editor.cxx
fast_slow.fl
file_chooser.cxx
fl_jpeg_image.cxx
fonts.cxx
forms.cxx
fractals.cxx
fracviewer.cxx
fracviewer.h
fromdos.c
fullscreen.cxx
gl_overlay.cxx
glpuzzle.cxx
hello.cxx
help.cxx
iconize.cxx
image.cxx
inactive.fl
input.cxx
input_choice.cxx
keyboard.cxx
keyboard.h
keyboard_ui.fl
label.cxx
line_style.cxx
list_visuals.cxx
makedepend
makefile.wat
mandelbrot.cxx
mandelbrot.h
mandelbrot_ui.fl
mcast_launcher.cxx
mcast_rx.cxx
mcast_tx.cxx
menubar.cxx
message.cxx
minimum.cxx
navigation.cxx
output.cxx
overlay.cxx
pack.cxx
pixmap.cxx
pixmap_browser.cxx
pixmaps
preferences.fl
radio.fl
resize.fl
resizebox.cxx
rgb.txt
scroll.cxx
shape.cxx
subwindow.cxx
sudoku.app
sudoku.cxx
sudoku.ico
sudoku.rc
sudokurc.h
symbols.cxx
tabs.fl
threads.cxx
threads.h
tile.cxx
tiled_image.cxx
trackball.c
trackball.h
unittests.cxx
utf8.cxx
valuators.fl
./vc2005:
./vcnet:
./visualc:
./watcom:
./xutf8:
COPYING
MAPPINGS
Makefile
Makefile.bak
README
Ximint.h
Xlibint.h
case.c
headers
imKStoUCS.c
is_right2left.c
is_spacing.c
keysym2Ucs.c
lcUniConv
makedepend
makedepend.bak
stamp-h
stamp-h.in
test.c
test2.c
ucs2fontmap.c
ucs2fontmap.c.mini
utf8Input.c
utf8Utils.c
utf8Wrap.c
utils
./xutf8/lcUniConv:
8bit_tab_to_h.c
COPYRIGHT
README
armscii_8.h
ascii.h
big5.h
big5_emacs.h
cjk_tab_to_h.c
cp1133.h
cp1251.h
cp1255.h
cp1256.h
gb2312.h
georgian_academy.h
georgian_ps.h
iso8859_1.h
iso8859_10.h
iso8859_11.h
iso8859_13.h
iso8859_14.h
iso8859_15.h
iso8859_16.h
iso8859_2.h
iso8859_3.h
iso8859_4.h
iso8859_5.h
iso8859_6.h
iso8859_7.h
iso8859_8.h
iso8859_9.h
iso8859_9e.h
jisx0201.h
jisx0208.h
jisx0212.h
koi8_c.h
koi8_r.h
koi8_u.h
ksc5601.h
mulelao.h
tatar_cyr.h
tcvn.h
tis620.h
ucs2be.h
utf8.h
viscii.h
./xutf8/utils:
INSTALL
Makefile
README
case.sh
conv_gen.c
convert_map.c
create_table.c
euc_tw.c
non_spacing.sh
tbl_gen.sh

View File

@ -7,13 +7,13 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.colbrowser</string>
<string>org.fltk.test.colbrowser</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>FLTK</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>

View File

@ -7,13 +7,13 @@
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.curve</string>
<string>org.fltk.test.curve</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<string>FLTK</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>

View File

@ -0,0 +1,20 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>English</string>
<key>CFBundleExecutable</key>
<string>${EXECUTABLE_NAME}</string>
<key>CFBundleIdentifier</key>
<string>com.yourcompany.symbols</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleVersion</key>
<string>1.0</string>
</dict>
</plist>

View File

@ -135,11 +135,11 @@ UNINSTALL_DESKTOP = @UNINSTALL_DESKTOP@
.c.o:
echo Compiling $<...
$(CC) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CFLAGS) -c $<
$(CC) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CFLAGS) -c $< -o $@
.cxx.o:
echo Compiling $<...
$(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -c $<
$(CXX) -I.. $(ARCHFLAGS) @PNGINC@ @JPEGINC@ @ZLIBINC@ $(CXXFLAGS) -c $< -o $@
.man.0 .man.1 .man.3 .man.6:
echo Formatting $<...

View File

@ -329,6 +329,7 @@ void Fl_Browser::item_draw(void* v, int X, int Y, int W, int H) const {
Fl_Color lcol = textcolor();
Fl_Align talign = FL_ALIGN_LEFT;
// check for all the @-lines recognized by XForms:
//#warning FIXME This maybe needs to be more UTF8 aware now...?
while (*str == format_char() && *++str && *str != format_char()) {
switch (*str++) {
case 'l': case 'L': tsize = 24; break;

View File

@ -28,6 +28,7 @@
#include <FL/Fl.H>
#include <FL/Fl_Browser.H>
#include <stdio.h>
#include <FL/fl_utf8.H>
int Fl_Browser::load(const char *filename) {
#define MAXFL_BLINE 1024
@ -36,7 +37,7 @@ int Fl_Browser::load(const char *filename) {
int i;
clear();
if (!filename || !(filename[0])) return 1;
FILE *fl = fopen(filename,"r");
FILE *fl = fl_fopen(filename,"r");
if (!fl) return 0;
i = 0;
do {

View File

@ -538,13 +538,13 @@ Fl_File_Browser::load(const char *directory,// I - Directory to load
// Open the file that contains a list of mounted filesystems...
//
mtab = fopen("/etc/mnttab", "r"); // Fairly standard
mtab = fl_fopen("/etc/mnttab", "r"); // Fairly standard
if (mtab == NULL)
mtab = fopen("/etc/mtab", "r"); // More standard
mtab = fl_fopen("/etc/mtab", "r"); // More standard
if (mtab == NULL)
mtab = fopen("/etc/fstab", "r"); // Otherwise fallback to full list
mtab = fl_fopen("/etc/fstab", "r"); // Otherwise fallback to full list
if (mtab == NULL)
mtab = fopen("/etc/vfstab", "r"); // Alternate full list file
mtab = fl_fopen("/etc/vfstab", "r"); // Alternate full list file
if (mtab != NULL)
{

View File

@ -43,6 +43,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <FL/fl_utf8.H>
#include "flstring.h"
#include <errno.h>
#include <sys/types.h>
@ -203,7 +204,7 @@ Fl_File_Icon::find(const char *filename,// I - Name of file */
else
filetype = PLAIN;
#else
if (!stat(filename, &fileinfo))
if (!fl_stat(filename, &fileinfo))
{
if (S_ISDIR(fileinfo.st_mode))
filetype = DIRECTORY;

View File

@ -44,6 +44,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <FL/fl_utf8.H>
#include "flstring.h"
#include <ctype.h>
#include <errno.h>
@ -139,7 +140,7 @@ Fl_File_Icon::load_fti(const char *fti) // I - File to read from
// Try to open the file...
if ((fp = fopen(fti, "rb")) == NULL)
if ((fp = fl_fopen(fti, "rb")) == NULL)
{
Fl::error("Fl_File_Icon::load_fti(): Unable to open \"%s\" - %s",
fti, strerror(errno));

View File

@ -42,6 +42,8 @@
# if USE_XFT
typedef struct _XftFont XftFont;
# elif !defined(WIN32) && !defined(__APPLE__)
# include <FL/Xutf8.h>
# endif // USE_XFT
class Fl_Font_Descriptor {
@ -49,7 +51,7 @@ public:
Fl_Font_Descriptor *next; // linked list for this Fl_Fontdesc
# ifdef WIN32
HFONT fid;
int width[256];
int *width[64];
TEXTMETRIC metr;
FL_EXPORT Fl_Font_Descriptor(const char* fontname, Fl_Fontsize size);
# elif defined(__APPLE_QD__)
@ -63,8 +65,8 @@ public:
ATSUTextLayout layout;
ATSUStyle style;
short ascent, descent, q_width;
short width[256];
bool knowWidths;
// short width[256];
// bool knowWidths;
char *q_name;
int size;
# elif USE_XFT
@ -73,13 +75,14 @@ public:
Fl_Fontsize size;
FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
# else
XFontStruct* font; // X font information
XUtf8FontStruct* font; // X UTF-8 font information
FL_EXPORT Fl_Font_Descriptor(const char* xfontname);
# endif
Fl_Fontsize minsize; // smallest point size that should use this
Fl_Fontsize maxsize; // largest point size that should use this
# if HAVE_GL
unsigned int listbase;// base of display list, 0 = none
char glok[64];
# endif
FL_EXPORT ~Fl_Font_Descriptor();
};

View File

@ -36,6 +36,7 @@
#include <FL/Fl_GIF_Image.H>
#include <stdio.h>
#include <stdlib.h>
#include <FL/fl_utf8.H>
#include "flstring.h"
// Read a .gif file and convert it to a "xpm" format (actually my
@ -82,7 +83,7 @@ Fl_GIF_Image::Fl_GIF_Image(const char *infname) : Fl_Pixmap((char *const*)0) {
FILE *GifFile; // File to read
char **new_data; // Data array
if ((GifFile = fopen(infname, "rb")) == NULL) {
if ((GifFile = fl_fopen(infname, "rb")) == NULL) {
Fl::error("Fl_GIF_Image: Unable to open %s!", infname);
return;
}

View File

@ -34,6 +34,7 @@
# include "Fl_Gl_Choice.H"
# include <FL/gl_draw.H>
# include "flstring.h"
# include <FL/fl_utf8.H>
# ifdef __APPLE__
# include <FL/Fl_Window.H>
@ -271,7 +272,7 @@ Fl_Gl_Choice *Fl_Gl_Choice::find(int m, const int *alistp) {
if (/*MaxCmapsOfScreen(ScreenOfDisplay(fl_display,fl_screen))==1 && */
visp->visualid == fl_visual->visualid &&
!getenv("MESA_PRIVATE_CMAP"))
!fl_getenv("MESA_PRIVATE_CMAP"))
g->colormap = fl_colormap;
else
g->colormap = XCreateColormap(fl_display, RootWindow(fl_display,fl_screen),

View File

@ -33,6 +33,7 @@
#include "Fl_Gl_Choice.H"
#include <FL/Fl_Gl_Window.H>
#include <stdlib.h>
#include <FL/fl_utf8.H>
////////////////////////////////////////////////////////////////
@ -293,7 +294,7 @@ void Fl_Gl_Window::flush() {
#else
SWAP_TYPE = UNDEFINED;
#endif
const char* c = getenv("GL_SWAP_TYPE");
const char* c = fl_getenv("GL_SWAP_TYPE");
if (c) {
if (!strcmp(c,"COPY")) SWAP_TYPE = COPY;
else if (!strcmp(c, "NODAMAGE")) SWAP_TYPE = NODAMAGE;

View File

@ -420,17 +420,17 @@ void Fl_Group::remove(Fl_Widget &o) {
// sizes array stores the initial positions of widgets as
// left,right,top,bottom quads. The first quad is the group, the
// second is the resizable (clipped to the group), and the
// rest are the children. This is a convenient order for the
// algorithm. If you change this be sure to fix Fl_Tile which
// rest are the children. This is a convienent order for the
// algorithim. If you change this be sure to fix Fl_Tile which
// also uses this array!
void Fl_Group::init_sizes() {
delete[] sizes_; sizes_ = 0;
}
int *Fl_Group::sizes() {
int* Fl_Group::sizes() {
if (!sizes_) {
int *p = sizes_ = new int[4*(children_+2)];
int* p = sizes_ = new int[4*(children_+2)];
// first thing in sizes array is the group's size:
if (type() < FL_WINDOW) {p[0] = x(); p[2] = y();} else {p[0] = p[2] = 0;}
p[1] = p[0]+w(); p[3] = p[2]+h();

View File

@ -61,6 +61,7 @@
#include <FL/x.H>
#include <stdio.h>
#include <stdlib.h>
#include <FL/fl_utf8.H>
#include "flstring.h"
#include <ctype.h>
#include <errno.h>
@ -717,13 +718,13 @@ Fl_Help_View::draw()
if (strcasecmp(buf, "LI") == 0)
{
#ifdef __APPLE_QUARTZ__
fl_font(FL_SYMBOL, fsize);
hv_draw("\245", xx - fsize + x() - leftline_, yy + y());
#else
fl_font(FL_SYMBOL, fsize);
hv_draw("\267", xx - fsize + x() - leftline_, yy + y());
#endif
// fl_font(FL_SYMBOL, fsize); // The default SYMBOL font on my XP box is not Unicode...
char buf[8];
wchar_t b[] = {0x2022, 0x0};
// buf[fl_unicode2utf(b, 1, buf)] = 0;
unsigned dstlen = fl_utf8fromwc(buf, 8, b, 1);
buf[dstlen] = 0;
hv_draw(buf, xx - fsize + x() - leftline_, yy + y());
}
pushfont(font, fsize);
@ -950,7 +951,10 @@ Fl_Help_View::draw()
if (qch < 0)
*s++ = '&';
else {
*s++ = qch;
int l;
l = fl_utf8encode((unsigned int) qch, s);
if (l < 1) l = 1;
s += l;
ptr = strchr(ptr, ';') + 1;
}
@ -1480,6 +1484,7 @@ Fl_Help_View::format()
popfont(font, fsize);
//#warning FIXME this isspace & 255 test will probably not work on a utf8 stream... And we use it everywhere!
while (isspace((*ptr)&255))
ptr ++;
@ -1760,7 +1765,10 @@ Fl_Help_View::format()
if (qch < 0)
*s++ = '&';
else {
*s++ = qch;
int l;
l = fl_utf8encode((unsigned int) qch, s);
if (l < 1) l = 1;
s += l;
ptr = strchr(ptr, ';') + 1;
}
@ -2202,6 +2210,10 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
if (qch < 0)
*s++ = '&';
else {
// int l;
// l = fl_utf8encode((unsigned int) qch, s);
// if (l < 1) l = 1;
// s += l;
*s++ = qch;
ptr = strchr(ptr, ';') + 1;
}
@ -2311,7 +2323,7 @@ Fl_Help_View::format_table(int *table_width, // O - Total table width
void
Fl_Help_View::free_data() {
// Releae all images...
// Release all images...
if (value_) {
const char *ptr, // Pointer into block
*attrs; // Pointer to start of element attributes
@ -2605,7 +2617,7 @@ Fl_Help_View::get_image(const char *name, int W, int H) {
} else if (name[0] != '/' && strchr(name, ':') == NULL) {
if (directory_[0]) snprintf(temp, sizeof(temp), "%s/%s", directory_, name);
else {
getcwd(dir, sizeof(dir));
fl_getcwd(dir, sizeof(dir));
snprintf(temp, sizeof(temp), "file:%s/%s", dir, name);
}
@ -2696,7 +2708,7 @@ void Fl_Help_View::follow_link(Fl_Help_Link *linkp)
snprintf(temp, sizeof(temp), "%s/%s", directory_, linkp->filename);
else
{
getcwd(dir, sizeof(dir));
fl_getcwd(dir, sizeof(dir));
snprintf(temp, sizeof(temp), "file:%s/%s", dir, linkp->filename);
}
}
@ -3139,7 +3151,7 @@ Fl_Help_View::load(const char *f)// I - Filename to load (may also have target)
if (strncmp(localname, "file:", 5) == 0)
localname += 5; // Adjust for local filename...
if ((fp = fopen(localname, "rb")) != NULL)
if ((fp = fl_fopen(localname, "rb")) != NULL)
{
fseek(fp, 0, SEEK_END);
len = ftell(fp);
@ -3296,11 +3308,8 @@ Fl_Help_View::value(const char *v) // I - Text to view
#ifdef ENC
# undef ENC
#endif
#ifdef __APPLE__
# define ENC(a, b) b
#else
// part b in the table seems to be mac_roman - beku
# define ENC(a, b) a
#endif
//
// 'quote_char()' - Return the character code associated with a quoted char.

View File

@ -36,6 +36,7 @@
#include <FL/fl_draw.H>
#include <FL/fl_ask.H>
#include <math.h>
#include <FL/fl_utf8.H>
#include "flstring.h"
#include <stdlib.h>
#include <ctype.h>
@ -57,9 +58,14 @@ const char* Fl_Input_::expand(const char* p, char* buf) const {
int width_to_lastspace = 0;
int word_count = 0;
int word_wrap;
// const char *pe = p + strlen(p);
if (input_type()==FL_SECRET_INPUT) {
while (o<e && p < value_+size_) {*o++ = '*'; p++;}
while (o<e && p < value_+size_) {
if (fl_utf8len((char)p[0]) >= 1) *o++ = '*';
p++;
}
} else while (o<e) {
if (wrap() && (p >= value_+size_ || isspace(*p & 255))) {
word_wrap = w() - Fl::box_dw(box()) - 2;
@ -79,27 +85,13 @@ const char* Fl_Input_::expand(const char* p, char* buf) const {
if (c < ' ' || c == 127) {
if (c=='\n' && input_type()==FL_MULTILINE_INPUT) {p--; break;}
if (c == '\t' && input_type()==FL_MULTILINE_INPUT) {
for (c = (o-buf)%8; c<8 && o<e; c++) *o++ = ' ';
for (c = fl_utf_nb_char((uchar*)buf, o-buf)%8; c<8 && o<e; c++) {
*o++ = ' ';
}
} else {
*o++ = '^';
*o++ = c ^ 0x40;
}
#ifdef __APPLE__
// In MacRoman, all characters are defined, and non-break-space is 0xca
} else if (c == 0xCA) { // nbsp
*o++ = ' ';
#else
// in ISO 8859-1, undefined characters are rendered as octal
// this is commented out since most X11 seems to use MSWindows Latin-1
//} else if (c >= 128 && c < 0xA0) {
// these codes are not defined in ISO code, so we output the octal code instead
// *o++ = '\\';
// *o++ = ((c>>6)&0x03) + '0';
// *o++ = ((c>>3)&0x07) + '0';
// *o++ = (c&0x07) + '0';
} else if (c == 0xA0) { // nbsp
*o++ = ' ';
#endif
} else {
*o++ = c;
}
@ -116,23 +108,24 @@ double Fl_Input_::expandpos(
int* returnn // return offset into buf here
) const {
int n = 0;
if (input_type()==FL_SECRET_INPUT) n = e-p;
else while (p<e) {
int c = *p++ & 255;
int chr = 0;
if (input_type()==FL_SECRET_INPUT) {
while (p<e) {
if (fl_utf8len((char)p[0]) >= 1) n++;
p++;
}
} else while (p<e) {
int c = *p & 255;
if (c < ' ' || c == 127) {
if (c == '\t' && input_type()==FL_MULTILINE_INPUT) n += 8-(n%8);
else n += 2;
#ifdef __APPLE__
// in MacRoman, all characters are defined
#else
// in Windows Latin-1 all characters are defined
//} else if (c >= 128 && c < 0xA0) {
// these codes are not defined in ISO code, so we output the octal code instead
// n += 4;
#endif
if (c == '\t' && input_type()==FL_MULTILINE_INPUT) {
n += 8-(chr%8);
chr += 8-(chr%8);
} else n += 2;
} else {
n++;
}
chr += fl_utf8len((char)p[0]) >= 1;
p++;
}
if (returnn) *returnn = n;
return fl_width(buf, n);
@ -344,6 +337,10 @@ void Fl_Input_::drawtext(int X, int Y, int W, int H) {
}
fl_pop_clip();
if (Fl::focus() == this) {
fl_set_spot(textfont(), textsize(),
(int)xpos+curx, Y+ypos-fl_descent(), W, H);
}
}
static int isword(char c) {
@ -423,14 +420,20 @@ void Fl_Input_::handle_mouse(int X, int Y, int /*W*/, int /*H*/, int drag) {
const char *l, *r, *t; double f0 = Fl::event_x()-X+xscroll_;
for (l = p, r = e; l<r; ) {
double f;
t = l+(r-l+1)/2;
int cw = fl_utf8len((char)l[0]);
if (cw < 1) cw = 1;
t = l+cw;
f = X-xscroll_+expandpos(p, t, buf, 0);
if (f <= Fl::event_x()) {l = t; f0 = Fl::event_x()-f;}
else r = t-1;
else r = t-cw;
}
if (l < e) { // see if closer to character on right:
double f1 = X-xscroll_+expandpos(p, l+1, buf, 0)-Fl::event_x();
if (f1 < f0) l = l+1;
double f1;
int cw = fl_utf8len((char)l[0]);
if (cw > 0) {
f1 = X-xscroll_+expandpos(p, l + cw, buf, 0) - Fl::event_x();
if (f1 < f0) l = l+cw;
}
}
newpos = l-value();
@ -470,12 +473,33 @@ void Fl_Input_::handle_mouse(int X, int Y, int /*W*/, int /*H*/, int drag) {
}
int Fl_Input_::position(int p, int m) {
int is_same = 0;
was_up_down = 0;
if (p<0) p = 0;
if (p>size()) p = size();
if (m<0) m = 0;
if (m>size()) m = size();
if (p == m) is_same = 1;
while (p < position_ && p > 0 && (size() - p) > 0 &&
(fl_utf8len((char)(value() + p)[0]) < 1)) { p--; }
int ul = fl_utf8len((char)(value() + p)[0]);
while (p < size() && p > position_ && ul < 0) {
p++;
ul = fl_utf8len((char)(value() + p)[0]);
}
while (m < mark_ && m > 0 && (size() - m) > 0 &&
(fl_utf8len((char)(value() + m)[0]) < 1)) { m--; }
ul = fl_utf8len((char)(value() + m)[0]);
while (m < size() && m > mark_ && ul < 0) {
m++;
ul = fl_utf8len((char)(value() + m)[0]);
}
if (is_same) m = p;
if (p == position_ && m == mark_) return 0;
//if (Fl::selection_owner() == this) Fl::selection_owner(0);
if (p != m) {
if (p != position_) minimal_update(position_, p);
@ -551,7 +575,7 @@ static void undobuffersize(int n) {
// all changes go through here, delete characters b-e and insert text:
int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
int ul, om, op;
was_up_down = 0;
if (b<0) b = 0;
@ -559,6 +583,13 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
if (b>size_) b = size_;
if (e>size_) e = size_;
if (e<b) {int t=b; b=e; e=t;}
while (b != e && b > 0 && (size_ - b) > 0 &&
(fl_utf8len((value_ + b)[0]) < 1)) { b--; }
ul = fl_utf8len((char)(value_ + e)[0]);
while (e < size_ && e > 0 && ul < 0) {
e++;
ul = fl_utf8len((char)(value_ + e)[0]);
}
if (text && !ilen) ilen = strlen(text);
if (e<=b && !ilen) return 0; // don't clobber undo for a null operation
if (size_+ilen-(e-b) > maximum_size_) {
@ -605,7 +636,9 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
size_ += ilen;
}
undowidget = this;
undoat = b+ilen;
om = mark_;
op = position_;
mark_ = position_ = undoat = b+ilen;
// Insertions into the word at the end of the line will cause it to
// wrap to the next line, so we must indicate that the changes may start
@ -615,7 +648,7 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
if (wrap()) {
// if there is a space in the pasted text, the whole line may have rewrapped
int i;
for (i=0; i<ilen; i++)
for (i=0; i<ilen; i++)
if (text[i]==' ') break;
if (i==ilen)
while (b > 0 && !isspace(index(b) & 255) && index(b)!='\n') b--;
@ -624,8 +657,8 @@ int Fl_Input_::replace(int b, int e, const char* text, int ilen) {
}
// make sure we redraw the old selection or cursor:
if (mark_ < b) b = mark_;
if (position_ < b) b = position_;
if (om < b) b = om;
if (op < b) b = op;
minimal_update(b);
@ -702,6 +735,7 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
return 1;
case FL_FOCUS:
fl_set_spot(textfont(), textsize(), x(), y(), w(), h());
if (mark_ == position_) {
minimal_update(size()+1);
} else //if (Fl::selection_owner() != this)
@ -715,7 +749,9 @@ int Fl_Input_::handletext(int event, int X, int Y, int W, int H) {
} else //if (Fl::selection_owner() != this)
minimal_update(mark_, position_);
case FL_HIDE:
if (!readonly() && (when() & FL_WHEN_RELEASE))
fl_reset_spot();
if (!readonly() &&
(when() & (FL_WHEN_RELEASE | FL_WHEN_NOT_CHANGED)))
maybe_do_callback();
return 1;

View File

@ -38,7 +38,7 @@ void Fl_Menu_Button::draw() {
draw_label();
if (Fl::focus() == this) draw_focus();
if (box() == FL_FLAT_BOX) return; // for XForms compatability
int H = (int(labelsize()-3))&-2;
int H = (labelsize()-3)&-2;
int X = x()+w()-H*2;
int Y = y()+(h()-H)/2;
fl_color(active_r() ? FL_DARK3 : fl_inactive(FL_DARK3));

View File

@ -76,7 +76,8 @@ static Fl_Menu_Item* insert(
m->callback_ = 0;
m->user_data_ = 0;
m->flags = flags;
m->labeltype_ = m->labelfont_ = m->labelsize_ = m->labelcolor_ = 0;
m->labeltype_ = m->labelsize_ = m->labelcolor_ = 0;
m->labelfont_ = FL_HELVETICA;
return array;
}

View File

@ -39,6 +39,7 @@
#include <config.h>
#include <stdio.h>
#include <stdlib.h>
#include <FL/fl_utf8.H>
extern "C"
{
@ -69,7 +70,7 @@ Fl_PNG_Image::Fl_PNG_Image(const char *png) // I - File to read
// Open the PNG file...
if ((fp = fopen(png, "rb")) == NULL) return;
if ((fp = fl_fopen(png, "rb")) == NULL) return;
// Setup the PNG data structures...
pp = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL);

Some files were not shown because too many files have changed in this diff Show More