Commit Graph

9280 Commits

Author SHA1 Message Date
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
4ba92a99bb Document how to build universal apps for macOS 2021-04-29 18:32:19 +02:00
ManoloFLTK
9df287b415 Cleaner access to Fl_Gl_Window_Driver objects. 2021-04-29 10:40:18 +02:00
Albrecht Schlosser
f9e8ef0b7a Fix "Fl_Shared_Image: use of unitialized data" (#216)
- fix issue as proposed
- fix more potential access to uninitialized data issues
- document Fl_Shared_Image::add_handler()
- document typedef Fl_Shared_Image::Fl_Shared_Handler()
2021-04-28 13:36:34 +02:00
Albrecht Schlosser
189f7ec3ac Fix version number in doxygen docs
... when generated with configure/make.
2021-04-28 12:48:52 +02:00
ManoloFLTK
3bc9017970 Slightly simplify gl_texture_fifo::compute_texture()
The font size is set to the value necessary for the GL scene before
computing the string width.
Virtual Fl_Gl_Window_Driver::effective_size() becomes unnecessary.
2021-04-27 09:09:08 +02:00
Albrecht Schlosser
6e70afc811 Update copyright year in documentation footer 2021-04-26 22:33:01 +02:00
Albrecht Schlosser
556e895dc1 CMake: Document FLTKConfig.cmake and set FLTK_INCLUDE_DIR
Some of the output variables had not been documented, and the "new"
variable for FLTK include directories is 'FLTK_INCLUDE_DIRS' (plural)
rather than 'FLTK_INCLUDE_DIR'.

FLTK_INCLUDE_DIR is now also set for compatibility with FindFLTK.cmake
supplied by CMake.
2021-04-26 15:03:00 +02:00
Albrecht Schlosser
7a7f3c3324 Avoid "Bogus FL_MOVE/FL_DRAG events" (#76)
Fix sending bogus events if CONSOLIDATE_MOTION is on.
2021-04-26 14:15:55 +02:00
Albrecht Schlosser
7b70d2c90d Fix handle_events demo build w/o OpenGL
test/handle_events.cxx can optionally be built with an Fl_Gl_Window,
  but this doesn't work if OpenGL support (libfltk_gl) is disabled.
2021-04-22 12:34:49 +02:00
ManoloFLTK
d01aab2ece Replace list of excluded platforms by name of chosen platform.
Since FL/platform.H defines USE_X11 for the X11 platform, it's better to target
the X11 platform by
  #include <FL/platform.H>
  #if USE_X11
rather than by
  #if !defined(_WIN32) && !defined(__APPLE__) && !defined(__ANDROID__)
that would have to grow with future platforms.
2021-04-19 14:07:37 +02:00
Albrecht Schlosser
72901a626c Fix potential buffer overrun (WIN32 only) 2021-04-16 18:08:15 +02:00
ManoloFLTK
cacaa17499 Minor simplification in Fl_Gl_Window_Driver::capture_gl_rectangle() 2021-04-16 09:31:02 +02:00
Albrecht Schlosser
41b1f1f911 Improve documentation (test/editor) (#219)
Add missing declaration, update more declarations.
2021-04-14 21:42:04 +02:00
ManoloFLTK
78aa959ab9 Fix Fl_Cairo_Graphics_Driver::rect and Fl_Cairo_Graphics_Driver::rectf 2021-04-14 13:59:16 +02:00
Daniel G
87679110f9 Update README.Unix.txt
Replace svn instructions by git instructions
2021-04-13 17:05:50 +02:00
Daniel G
5c0fe8f411 Update Fl_WinAPI_Window_Driver.H
Fix copy paste error.
2021-04-13 12:23:01 +02:00
Albrecht Schlosser
3611d788e3 Fix CMake install procedure (#212)
Only install header files to the FL/ include directory.
2021-04-11 21:56:28 +02:00
Albrecht Schlosser
1e2137668a Fix CMake warning 2021-04-08 15:51:05 +02:00
Albrecht Schlosser
02dfdd590d Fix macOS bundle: set missing fields for test apps
- MACOSX_BUNDLE_BUNDLE_NAME: CFBundleName
 - MACOSX_BUNDLE_GUI_IDENTIFIER: CFBundleIdentifier

test/demo.cxx: Remove confusing quotes from demo variable output.
2021-04-08 13:50:32 +02:00
Albrecht Schlosser
22cb8a7fdb Make Fl_Input::handle_key() protected (#203)
... as requested in this comment:
https://github.com/fltk/fltk/issues/211#issuecomment-814235771
2021-04-07 19:14:25 +02:00
Albrecht Schlosser
7f969b5496 Remove static variable, fix gcc warning [-Wclobbered] (#203)
PR #203 "Multithread fix for PNG loading" includes a suggested fix
that moves the variable fp to the Fl_PNG_Image structure.

This commit fixes the threading issue by allocating the variable fp
with new, avoiding the [-Wclobbered] warning w/o using a static var.

The same issue is now also fixed in Fl_JPEG_Image.
2021-04-07 10:55:13 +02:00
ManoloFLTK
4e086a1cdf Merge remote-tracking branch 'refs/remotes/origin/master' 2021-04-04 19:27:03 +02:00
ManoloFLTK
f8d1b83a0e Fix for issue #209: Gtk-CRITICAL messages from native file chooser
Thanks to K.R. for the fix.
2021-04-04 19:26:38 +02:00
Albrecht Schlosser
278adc097c Fix "Gtk-CRITICAL messages from native file chooser" (#209)
See GitHub Issue #209: https://github.com/fltk/fltk/issues/209

Warning was: "Gtk-CRITICAL **: ... gtk_widget_set_sensitive: assertion 'GTK_IS_WIDGET (widget)' failed

Close #209
2021-04-04 15:45:56 +02:00
ManoloFLTK
30725faf0a Move the X11-specific part of GTK native file chooser to Fl_X11_System_Driver 2021-03-31 18:58:34 +02:00
ManoloFLTK
2a6e9d9493 Fl_X11_System_Driver::probe_for_GTK() is now Fl_Posix_System_Driver::probe_for_GTK() 2021-03-31 10:58:03 +02:00
ManoloFLTK
778a4577d4 Move quadruple_dlopen() to Fl_Posix_System_Driver.cxx where it's used. 2021-03-31 10:39:06 +02:00
ManoloFLTK
ba03dde15c Move probe_for_GTK() to class Fl_Posix_System_Driver from Fl_X11_System_Driver.
Similarly move dlopen_or_dlsym().
This move is because GTK is not X11-specific.
2021-03-31 09:51:10 +02:00
ManoloFLTK
ef41409759 Add guard against multiple inclusion of header file. 2021-03-27 19:05:29 +01:00
ManoloFLTK
4657e988f7 Remove X11-specific code from platform-independent Fl_PostScript.cxx 2021-03-26 07:52:21 +01:00
Greg Ercolano
4951fd1801 Better fix for issue #206.
Albrecht caught a problem with my strncat use (see comments for 12d8da9c).

I noticed we have fl_strlcpy() and fl_strlcat() which is what was really
needed here.
2021-03-23 18:27:30 -07:00
Greg Ercolano
12d8da9cb6 Solve issue #206 warning. 2021-03-23 12:24:04 -07:00
Greg Ercolano
8a9e25cdac Optimization for pixel loop.
As per erco's comments on fltk.coredev, Mar 21 2021
in thread Subject: Re: 1.4 build failing on OSX for me
2021-03-23 12:18:41 -07:00
Albrecht Schlosser
5fb6713485 Remove unused #include statements
Cairo is not used in this file, math.h is not necessary, and stdio.h
is only required if USE_PANGO is false.
2021-03-22 22:57:24 +01:00
Greg Ercolano
d6d1d8afe4 Solve issue #204, wrong default for labelfgcolor()
FL_BLACK changed to FL_FOREGROUND_COLOR as per docs.
2021-03-22 07:58:47 -07:00
Albrecht Schlosser
62ff323b70 Add missing include file stdlib.h for abs(int)
This file was included (in math.h or elsewhere) on Linux and latest
macOS versions but maybe not in earlier macOS versions or with other
configuration options.
2021-03-22 00:13:47 +01:00
Albrecht Schlosser
edfe684419 Windows: fix fl_filename_isdir()
- convert filename from UTF-8 to "Windows wide chars"
- use GetFileAttributesW() instead of _stat()
2021-03-21 19:36:27 +01:00
Albrecht Schlosser
8d26d5ed4b Hide window in quit callback in wizard-simple example 2021-03-21 02:10:19 +01:00
Albrecht Schlosser
90dbf0c77d Fix menu-with-images example w/o using exit()
Use window->hide() in quit callback instead.
2021-03-21 01:58:54 +01: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
Greg Ercolano
bd52db0b95 Added docs for public fl_vsnprintf() (STR #3413)
Applied vsnprintf_v2.patch from STR#3413 which documents
the previously undocumented function, so that it shows up
here in the doxygen docs:

    Files -> File List -> vsnprintf.c -> fl_vsnprintf()

This commit does not solve STR #3413, just adds the recommended documentation
for fl_vsnprintf(). Other functions in src/vsnprintf.c could use docs too.

See the bottom of comment #5 in the STR for recommendations to fully solve.
2021-03-19 09:22:01 -07:00
Albrecht Schlosser
edd52ca1e8 Add fluid callback demo program to examples folder
This example demonstrates how to build an entire program using fluid
and how to add static and virtual class methods as callbacks.
2021-03-19 13:48:41 +01:00
Greg Ercolano
19ae897553 Added chart-simple example 2021-03-18 19:41:27 -07:00
fire-eggs
0688c77c33 Fix stack corruption when loading GIF 2021-03-18 07:02:14 +01:00
ManoloFLTK
a4866ffc21 Partial fix for issue #188.
This fixes the inconsistency created by the possibility to change img->w() and img->h()
values. The fix is to use img->data_w() and img->data_h() that have constant values.
2021-03-15 15:12:25 +01:00
Albrecht Schlosser
a620ef5b37 Fix Linux build with --enable-pango 2021-03-15 15:06:23 +01:00
ManoloFLTK
1fbcae13bd Create class Fl_Cairo_Graphics_Driver.
That class is extracted from inside Fl_PostScript_Graphics_Driver and might
become handy in the future.
2021-03-15 14:09:50 +01:00
ManoloFLTK
a3cb4af739 Class Fl_PostScript_Graphics_Driver: better separation of what varies with USE_PANGO 2021-03-15 08:13:21 +01:00