Commit Graph

50 Commits

Author SHA1 Message Date
Matthias Melcher
4ddcbc81de No default values in plain C 2023-01-20 16:20:01 +01:00
Matthias Melcher
2c595e8dde STR 2822: function to count bytes in a UTF-8 string 2023-01-20 16:13:00 +01:00
ManoloFLTK
b9852ff58f Add cross-platform fl_close_fd(int fd) to close a file descriptor 2022-12-17 19:13:30 +01:00
Albrecht Schlosser
717a7d266b Remove '#include <sys/stat.h>' from FL/platform_types.h
- Add this include statement only where needed.
- Rename Fl_System_Driver::stat() to flstat().

This fixes an issue when using some (!) MinGW 64-bit build systems
that obviously '#define stat _stat64' or similar. This would
result in compiler problems if 'stat()' is a member function of
Fl_System_Driver.
2022-04-03 22:01:41 +02:00
Albrecht Schlosser
1684eb7efe Fix a type (comment only) 2021-05-02 17:04:16 +02:00
Albrecht Schlosser
41266df7ae Remove unnecessary system includes from public headers
Add includes of system headers in the implementation files
where necessary.
2021-03-21 00:42:28 +01:00
Albrecht Schlosser
f09e17c3c5 Remove $Id$ tags, update URL's, and more
- remove obsolete svn '$Id$' tags from all source files
- update .fl files and generated files accordingly
- replace 'http://www.fltk.org' URL's with 'https://...'
- replace bug report URL 'str.php' with 'bugs.php'
- remove trailing whitespace
- fix other whitespace errors flagged by Git
- add and/or fix missing or wrong standard headers
- convert tabs to spaces in all source files

The only relevant code changes are in the fluid/ folder where
some .fl files and other source files were used to generate
the '$Id' headers and footers.
2020-07-06 20:28:20 +02:00
Albrecht Schlosser
4c1b92eb52 Implement fl_putenv() as cross-platform putenv() 2020-02-10 12:10:40 +01:00
Albrecht Schlosser
52ae3582a2 Replace "WIN32" with "_WIN32" or "Windows".
Replace compiler/preprocessor/platform macro "WIN32" with "_WIN32".
Replace "WIN32" in text and documentation with "Windows".
Replace "MSWindows" with "Windows".

To do: README.Windows.txt (and maybe other documentation as well)
needs updates.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12655 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-02-09 14:39:42 +00:00
Albrecht Schlosser
4a088d28f5 Add missing platform wrapper fl_chdir() for chdir().
Tested under Windows and Linux, but not yet used in library code.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12549 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-11-10 12:56:00 +00:00
Albrecht Schlosser
f9cfe1378d Rename fl_open_ext() parameter 'translation' to 'binary'.
The default (0) is 'text' mode, non-zero is 'binary' mode on platforms
that distinguish text and binary mode.

Currently Windows is the only supported platform that needs this.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12500 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15 12:34:24 +00:00
Albrecht Schlosser
41f92be2f1 Replace remaining calls to unlink() with fl_unlink().
Tested under Linux, MinGW, and Visual Studio 2015.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12496 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-15 10:18:53 +00:00
Manolo Gouy
789ed089c9 Add fl_open_ext() to control whether the file is opened in binary/text mode.
This new function allows to write Fl_SVG_Image::fl_gzopen() in a completely platform-independent way.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12489 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-12 14:42:12 +00:00
Manolo Gouy
7a9d5be6cb Undo commit at r.12475 that is not adequate.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12476 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-04 12:21:46 +00:00
Manolo Gouy
5e6bf76b0a Fl_SVG_Image class: add support for compressed .svgz image files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12475 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2017-10-04 11:46:33 +00:00
Albrecht Schlosser
d56e2ec9f0 Fix typos.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11560 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-09 10:42:17 +00:00
Manolo Gouy
fd600aa239 Rewrite fl_utf8.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11467 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 19:41:14 +00:00
Manolo Gouy
4fcefc68f8 Remove the platform-dependent type xchar
File fl_utf8.h defines the xchar type with a platform-dependent value (wchar_t or unsigned short).
But it is used exclusively by WIN32 code (0 use in cross-platform code, 0 use in APPLE
or in USE_X11 code).
Thus, we can just get rid of this type and replace it by wchar_t where it is used.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 09:29:51 +00:00
Manolo Gouy
8ee4c7303f Begin to clean fl_utf8.h from its platform-dependent content.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11457 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 06:12:12 +00:00
Albrecht Schlosser
35c4ae5527 Don't expose X11 headers in user space any more (mostly).
Platform headers should not be #include'd in public FLTK header files,
so that user space is not polluted by platform specific definitions.

See discussion and test file in discussion in fltk.general:
https://groups.google.com/forum/#!topic/fltkgeneral/gzmdRk2LvAk
https://groups.google.com/d/msg/fltkgeneral/gzmdRk2LvAk/EOe314ChBgAJ

This commit fixes FL/fl_utf8.h to #include X11 headers only if compiled
in the FLTK library (same as in FLTK 1.3.4, svn r 11266).

Todo (FLTK 1.4): Remove more unnecessary (unwanted) system header #include
statements from FL/x.H and other public header files.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11268 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 12:40:53 +00:00
Albrecht Schlosser
df94673b61 Fix C++ comment in C header file + typos.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11265 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 10:53:25 +00:00
Matthias Melcher
53859c584f Add support for SDL as a base library on OS X.
This commit adds the basic setup in CMake to allow SDL as a base
library for FLTK on OS X (and probably for other platforms as well).

The SDL library driver set is derived from yet another new driver
set named 'Pico'. 'Pico' is a base class for a driver that will
allow porting of FLTK with the tinyest amount of effort. This 
implementation of the SDL driver shall be documented very well
to explain the porting process.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11262 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-02 00:54:37 +00:00
Albrecht Schlosser
d67e9ccb73 Fix compiler warnings (STR #2988) - final commit.
This commit includes all fixes from branch-1.3 (svn r 11243) and additional
fixes for warnings that crept in during the porting efforts, particularly
C++ ("//") comments in C and included header files, and some more.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11246 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-27 17:27:21 +00:00
Matthias Melcher
5d1df0e789 Details on PORTME items. Move fl_parse_color() to screen drivers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11163 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-13 12:57:00 +00:00
Matthias Melcher
50ee3bcd66 Mark places that need to be refactored with // PORTME:
Searching for __APPLE, WIN32 or X11 did give me many false results. I instead marked most ifdef's that I would like to get rid of with the text // PORTME:, so they can be easily found by a global search.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11155 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-11 12:02:36 +00:00
Matthias Melcher
94f0278d47 Porting efforts, minimal Android stuff, cleanup.
- Moving code around for Fl_Double_Window, but not yet happy
- Tested CMake for Android cross compilation. Very happy!

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11142 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-02-09 21:54:38 +00:00
Matthias Melcher
acf6c881d3 Updated platform specific #if's to report unimplemented code when compiling with FL_PORTING defined and WIN32 and __APPLE__ undefined>
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@10989 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-01-03 22:54:29 +00:00
Albrecht Schlosser
c4c7767fd8 Remove more superfuous comments, fix one typo.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10763 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-16 13:42:25 +00:00
Albrecht Schlosser
5573c35ff1 Fix spelling errors and improve documentation.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10759 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2015-06-15 20:24:41 +00:00
Ian MacArthur
0c90a7b7f4 Remove macros that (re)define hypot from fl_utf8.h,
when building on a WIN32 host.

I am not sure why these were here, but on one of my
(very) non-standard configurations this was causing
the build to fail.

After some discussion on fltk.dev, we decided to 
removed them since no one thinks they are needed
(please tell me if it turns out that the are!)

Note: that discussion also considered whether the
other (re)defines in that file, e.g. for stricmp
and strnicmp and others were useful; I have left
these in place for now, though I beleieve they are
not needed nor useful.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10259 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-08-28 09:34:07 +00:00
Lauri Kasanen
bbc8782b6a Move Xutf8.h to src/, update includes, refresh makedepends
This is an internal header.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10248 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2014-08-23 08:41:58 +00:00
Greg Ercolano
4f4a8fc3c7 Modifications to all LGPL headers for STR #2685.
(to clarify static exception LGPL by changing license references)



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8864 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-07-19 04:49:30 +00:00
Ian MacArthur
be6df55717 More attempts to clean up WIN32 handling of UTF16 surrogate pairs.
In particular, I have added a new function to src/fl_utf.c called fl_ucs_to_Utf16() which
converts a single 32-bit Unicode value into one (or more) UTF16 cells.

This is needed in the win32 char-by-char text width() logic, and I suspect may also be useful in the OSX code in some places.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@8585 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2011-04-13 15:43:22 +00:00
Matthias Melcher
1bac8a0cca Fixed crashes when Fl_Text_* detects illegal UTF 8 sequences. Widgets will not do any further processing but just jump over the character. Screen representation depends largely on whatever the underlying OS does with those sequences, but I feel that this is out of the scope of this library. (STR 2348)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7965 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-12-06 18:22:22 +00:00
Matthias Melcher
e454f97acc Fixed Copyright to 2010.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7903 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-11-28 21:06:39 +00:00
engelsman
a10e58a690 added implementations of fl_wcwidth_() and fl_wcwidth() to src/fl_utf.c
these supercede the old fl_wcwidth() code in src/xutf8/fl_wcwidth.c.
also added corresponding declarations to FL/fl_utf.c, and updated
src/Fl_Text_Buffer.c to enable the call to fl_wcwidth()



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7551 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-04-20 21:43:31 +00:00
Matthias Melcher
2a2e0821c9 Small fixes
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@7507 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2010-04-15 08:56:37 +00:00
Albrecht Schlosser
4fa7fde790 Added missing svn properties and $Id$ tags.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6942 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-11-18 12:22:51 +00:00
Matthias Melcher
b1ba38da60 Updated doxygen docs for Fl_Input_ to get a greater insight into the code. I'll try to get full Unicode support in soon. The current code uses some interesting solutions ;-).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6770 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-04-18 18:52:59 +00:00
engelsman
78da588135 grouped similar functions and added summary information in unicode.dox
corrected mismatched parameter names and typos on fl_utf8.h and fl_utf8.cxx



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6769 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-04-18 11:51:32 +00:00
engelsman
982f297d33 added doxygen one-liners for more UTF-8 routines in fl_utf*.[hc]*
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6768 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-04-17 17:03:49 +00:00
Matthias Melcher
d3206f01ec More Fl_Input keyboard fixes / OS X transparency for RGBA data / some utf8 reorganisation
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6765 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-04-15 08:35:28 +00:00
Greg Ercolano
50a92455fe Fixes for SGI builds (STR#2174)
1) C++ style comments in C files converted to /* */
   2) #warning's had to be #ifdef'ed out (#if !defined(sgi)..)
With these mods, 1.3.x compiles on IRIX 6.5 with no failures.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6680 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-03-14 02:11:31 +00:00
Matthias Melcher
167d767e0f Changed the copyright to 2009 for header files. Still todo: src and test directory.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6614 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2009-01-01 16:11:32 +00:00
Fabien Costantini
60335167b2 + Fixed non standard fltk utf8 files headers.
Kept original author and copyright.
  Added standard fltk LGPL header notice

+ Added missing comment to fl_width() related to latest utf8 STR#2086 related fix in r6539 and r6540.



git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6542 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-12-04 20:20:30 +00:00
Matthias Melcher
a26d5408a1 STR 1952: Fixed first modifier key event, some minor utf8 orrections.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6416 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-13 19:26:18 +00:00
Fabien Costantini
fdeb60898e #STR2056 partial fixes : wsock API now compiles ok, but there are still all utf8 stuff that won't compile: fl_utf8.cxx, fl_set_fonts_win32.cxx won't compile yet and Fl_Preferences recent utf8 addon should be checked for Cygwin.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6375 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-10-04 16:35:58 +00:00
Matthias Melcher
28dacd9509 Moving simple type definitions into their own header file, so we can create a 'C' header and dont need to include the 'C++' Enumerations.H
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6312 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-19 18:49:00 +00:00
Matthias Melcher
e8f467b9e3 Updating fl_utf8.h references. Fixing copyright date in .fl files.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6311 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-19 17:40:20 +00:00
Matthias Melcher
c7453106b9 Renameing C header for utf8 utilities from C++ extension .H to .h (via temporary file, part two)
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@6310 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2008-09-19 17:21:43 +00:00