Commit Graph

834 Commits

Author SHA1 Message Date
Albrecht Schlosser 14f842708d Fix indenting, whitespace errors and dependencies
(no code changes)
2021-10-27 20:52:08 +02:00
Albrecht Schlosser 8863ef7901 Avoid multiple definition of macro __fl_attr()
This could happen if both FL/fl_ask.H and fluid/Fl_Type.h were
included in the same file.
2021-10-17 12:24:39 +02:00
Albrecht Schlosser b6a69db9a6 Rename 'fileno()' method to 'get_fileno()' for MinGW
See fltk.coredev thread "fltk-1.4 fluid build broken on 32-bit mingw"
https://groups.google.com/g/fltkcoredev/c/W9LWbsNuGZg/m/MW1BVAkeAgAJ

This regression was introduced in commit c8c1f51db7 in an
attempt to fix a Visual Studio (MSVC) warning but broke "old" MinGW
builds that define 'fileno' as a macro.
2021-09-28 12:40:43 +02:00
Albrecht Schlosser c8c1f51db7 Fix MSVC "fileno" warnings in fluid 2021-08-30 23:45:16 +02:00
Albrecht Schlosser 1a8b94162d Fix Windows (VS) compiler warnings in fluid 2021-08-30 23:45:16 +02:00
Albrecht Schlosser 410a01c6db Add CMake compatibility functions and macros
CMake/compatibility.cmake: define functions and macros to be used
  if a particular CMake functionality requires a higher CMake version
  than FLTK's minimum CMake version, see 'cmake_minimum_required(...)'
  in the root CMakeLists.txt.

Note: target_link_directories() is available since CMake 3.13
2021-07-26 17:40:26 +02:00
Albrecht Schlosser 3c84894f19 Windows: Fix compiler warning: unused variable 2021-05-31 14:20:08 +02:00
ManoloFLTK b027d2ba57 Windows platform: use GDI+ to antialias oblique lines and curves. 2021-05-31 08:28:06 +02:00
Albrecht Schlosser 773467dee4 Refactor macOS bundle generation to avoid "quarantine"
macOS Big Sur 11.3 introduced a new "security feature" such that
app bundles created from existing bundle templates in downloaded
files (tar distibutions, expanded) could no longer be executed
without unsetting the "quarantine" attribute. This commit fixes
this by creating all bundles from scratch.

Known *workaround* for older tarballs and snapshots:

  $ xattr -d -r com.apple.quarantine xxx.app
2021-05-13 16:18:13 +02:00
Albrecht Schlosser b5cdd2fa71 Update copyright in fluid bundle (macOS: Info.plist) 2021-05-07 16:50:52 +02:00
Albrecht Schlosser a484541d4b CMake: improve detection and configuration of image libs
Also: fix old (pre 3.13) link_directories() usage
2021-04-30 19:47:47 +02:00
Albrecht Schlosser 2555e3b37e Fix build with Cairo for CMake < 3.13
target_link_directories() was introduced in CMake 3.13
2021-04-30 12:46:58 +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 49a78bc482 Fix cairo build (autoconf + CMake) + README's
- rewrite to use pkg-config with both autoconf + CMake
- remove hardcoded library names
- fix build dependencies and search directories
- remove or replace old and unused variables
- update README files

To be done:
- implement fallback for autoconf/configure if pkg-config is missing
- fix pango build (uses cairo internally)
2021-03-01 10:45:59 +01:00
Greg Ercolano 3c37cd033b Solves all "conversion" warnings in fluid for issue #109. 2021-02-18 16:37:51 -08:00
Albrecht Schlosser f519aceb85 Update dependencies 2020-11-21 13:20:26 +01:00
Albrecht Schlosser 5cb72ef065 Fix whitespace and minor formatting issues 2020-11-17 16:11:03 +01:00
Greg Ercolano d66e146a89 Handle single quotes 2020-11-01 12:16:23 -08:00
Greg Ercolano 4d503899a3 Mods for Albrecht's 09/19/20 code review 2020-11-01 12:16:23 -08:00
Greg Ercolano 890533a863 Code cleanup: moved keyword/type arrays to StyleParse
Needed to do this to prevent lower StyleParse class from #including upper CodeEditor.
2020-11-01 12:16:23 -08:00
Greg Ercolano cec029dbee Rewrite CodeEditor syntax highlighting for issue #135 2020-11-01 12:16:23 -08:00
ManoloFLTK 06504e1840 Add Fl_Option::OPTION_SHOW_SCALING to fluid's "Global FLTK Settings". 2020-09-27 10:02:39 +02:00
Albrecht Schlosser c9bee9ba80 Fix fluid output for international languages
The fluid version and other values in .fl files are written as float
values which means that locale settings apply since we enabled the
locale with "setlocale()".

Update the "rebuild" target in fluid and src folders to update
the fluid (.fl) files and related {.cxx|.h} files.
2020-09-16 12:15:54 +02:00
Albrecht Schlosser 340e2ac3a1 Fix .clang-format and some whitespace errors
.clang-format: UseTab: ForIndentation -> Never

Update fluid generated files
2020-08-22 13:35:42 +02:00
Michael Dickens 4c012bd706 Fluid: when linking include LDFLAGS order
LDFLAGS often contains "-L*" flags as provided outside the build to tell the linker where to search for libraries. If these are included -before- the ones used for internal linkage as found in LINKSHARED, and FLTK is already installed on the system, then the already-installed FLTK libraries will be found before those internal to the build. Moving the LDFLAGS after LINKSHARED generally solves this issue. Worst case the move won't hurt linking since all of the flags are still included in the link command.
2020-08-20 17:34:57 +02:00
Albrecht Schlosser fcd5239adc CMake: Fix macOS bundle wrapper generation
Now bundle wrapper scripts are created in the particular build folder,
i.e. in subdir 'Debug', 'Release' etc. in multi config builds (Xcode).
To do this, the scripts are now copied whenever the target is built
and not during the configuration phase.

To do: "install" wrapper scripts.
2020-08-18 16:23:25 +02:00
Albrecht Schlosser 4d0b04456e Update dependencies + fluid/generated files 2020-08-03 13:03:14 +02:00
Greg Ercolano 3d18d325f6 Commiting fluid generated template_panel.h as per issue #116
Regarding this comment thread:
https://github.com/fltk/fltk/pull/116#discussion_r458517450
2020-08-02 10:56:40 -07:00
Greg Ercolano 2141c63628 Implement + deploy fl_strdup() 2020-08-01 14:19:40 -07:00
Albrecht Schlosser 720b84ef9d CMake: refactor and reformat CMake files
- raise minimum CMake version from 2.6.3 to 3.2.3 (Jun 01, 2015)
- indent all CMake files according to the CMP (2 col.)
- refactor FLTK version number definitions and usage
- unify CMake and autoconf/configure variable names:
  - FL_VERSION -> FLTK_VERSION
  - FL_MAJOR_VERSION -> FLTK_VERSION_MAJOR
  - etc. for _MINOR_ and _PATCH_, respectively
  - note: this does not affect FL_VERSION etc. in source code
- generate "export headers" for all libraries (experimental: OFF)
- port some forgotten goodies from branch-1.3 to master
- merge and improve macro 'create_example' (WIP)
- remove "temporary" options and code for older CMake versions
- include and use 'GenerateExportHeader' (experimental, WIP: OFF)
  - note: created header files are not yet used
- build only *one* DLL with Visual Studio (tested, works)
  - similar to the bundled IDE projects in 1.3.x
- add some dynamically linked test/demo programs ('*-shared')
  if shared libraries are built (WIP)
- split 'macros.cmake': use one file per macro
2020-07-15 00:34:53 +02:00
Greg Ercolano da76085fe7 Import Albrecht's utf8 mods for FormatMessage() to fluid
Amended by Albrecht:
 - fix comments
 - add setlocale() to fluid

Note: the latter is also necessary to honor locale in GTK filechooser.
2020-07-14 13:14:37 +02:00
Albrecht Schlosser 8a3d3684ac Fluid: fix "trailing whitespace" errors (#100)
Fluid would write trailing whitespace at some points when generating
.cxx and .h files from .fl files.

This was an old issue but became obvious since we removed trailing
whitespace from source and header files recently.

This commit fixes all whitespace errors in files generated from .fl
files in the FLTK repository, i.e. in fluid/, src/, and test/ folders.

I can't guarantee that I found all possible whitespace errors, but
this commit:

Fixes #100
2020-07-11 18:48:42 +02:00
Greg Ercolano 2b88ce521d Shortcut tooltip elaborates on how to clear shortcut
A user was having trouble figuring this out on fltk.general,
seemed like a tooltip could have helped, so added it.
2020-07-06 21:31:25 -07: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 1da349579d Fix static code analyzer warnings
Note: there's more to do ...
2020-06-24 20:20:11 +02:00
Greg Ercolano 0dc16dd8c9 Added fluid command line '-d' debug flag 2020-06-19 08:59:48 -07:00
Greg Ercolano db07cea758 Fix problem with Windows pids being unsigned DWORDs
Had to get away from overloading PIDs with error codes,
so now error codes are returned separately from the PID.
2020-06-18 18:24:45 -07:00
Albrecht Schlosser 1078b8fe43 Update dependencies
Change sort order using -f (--ignore-case):
  fold lower case to upper case characters
2020-06-13 12:50:06 +02:00
Albrecht Schlosser adb2a719d4 Fix fluid undo/redo menu activation and deactivation
(1) fix typo in recent commit
(2) deactivate undo/redo menus on startup and after reset

Fixes issue #84
2020-05-24 22:24:48 +02:00
Greg Ercolano dcfe826b2f Fix broken undo
Replaced hardwired index#s for undo/redo menu items with dynamic lookup.
2020-05-24 09:02:24 -07:00
Albrecht Schlosser f930e834c5 Fix documentation URL's 2020-04-08 00:53:16 +02:00
Albrecht Schlosser d46351a591 Update copyright and FLTK site URL
All .fl files and generated files have been updated.
2020-04-06 20:04:16 +02:00
Albrecht Schlosser 21fb8725c6 Generate copyright year in fluid's about_panel
Copyright year "1998-XXXX" is now generated from current year.
This avoids editing the source code every year.
2020-04-06 20:02:42 +02:00
Albrecht Schlosser 8a7d4c9f61 Remove CodeWarrior "support"
Metrowerks CodeWarrior was an ancient macOS compiler (discontinued
since 2005) that defined the macro __MWERKS__. Code using this macro
and several comments have been removed.
2020-03-11 14:38:02 +01:00
Albrecht Schlosser a03220aba5 Fix a memory leak in fluid
Also fixed two typos in comments.
2020-03-08 12:42:30 +01:00
Albrecht Schlosser c4ed2341ec Fix potential null pointer dereferences in fluid 2020-02-11 19:01:48 +01:00
Albrecht Schlosser 8ea4b5b5b1 Fix static analyzer errors and warnings
Fix several bugs found by scan-build (more to come).
https://clang-analyzer.llvm.org/scan-build.html

See also current travis-ci build log with static analyzer, e.g.
https://travis-ci.com/fltk/fltk/jobs/285426415
(link may become invalid in the future).
2020-02-11 15:46:46 +01:00
Matthias Melcher 0a23d7fe6e Fluid needs to include text and binary files from within the .fl source directory.
Fixed including binaries and text to use the same path as the source code. This is consistent with the way the file is selected in the corresponding dialog box. Since the old behavior was false, I don't think this will break any existing projects.
2019-12-24 00:19:23 +01:00
ManoloFLTK c549b7acbd X11 platform: use Gnome printer dialog when the GTK library is available at run-time
The code to determine whether the GTK library is available is now in Fl_X11_System_Driver::probe_for_GTK()
called both by Fl_Printer::begin_job() and Fl_Native_File_Chooser.
New Fl::option OPTION_PRINTER_USES_GTK allows to deactivate use of
the Gnome print dialog.

Minor change in Fl_Native_File_Chooser: GTK version 3 is searched before version 2,
whereas the search order was the opposite before.
2019-09-15 15:57:29 +02:00
Albrecht Schlosser 6e683783f4 Fix another compiler warning (STR 3529)
fluid/template_panel.{fl|cxx}:

  .../fluid/template_panel.cxx:261:44: warning: ‘%s’ directive output
  may be truncated writing up to 255 bytes into a region of size
  between 0 and 1023 [-Wformat-truncation=]

Solution: increase buffer size from 1024 to 1400.
2019-08-29 17:32:26 +02:00