Commit Graph

2619 Commits

Author SHA1 Message Date
Matthias Melcher
5c90938aa3 #887: Fixes FLTK file chooser not releasing preview image.
...when hidden
2024-01-14 01:42:05 +01:00
Matthias Melcher
332a87aa43 #887: Fixes Fl_Shared_Image reference counting
- adds documentation to all calls
- changes implementation details on ::copy()
and copy(w,h)
2024-01-13 19:32:32 +01:00
Greg Ercolano
08e64283aa Add textattrib() get method+docs
Requested by Jonathan Griffitts during rust bindings.
2024-01-10 09:10:07 -08:00
Albrecht Schlosser
b4697c33ff Remove Fl_Simple_Terminal (replaced by Fl_Terminal)
... as discussed previously.
2024-01-06 18:29:25 +01:00
Albrecht Schlosser
c8112003ca Fix typo 2024-01-06 17:56:04 +01:00
Albrecht Schlosser
1d73c0195c Improve docs and add two new Fl_Menu_Item methods (#875)
This addresses some issues pointed out by GitHub Issue #875.

Documentation lacked details about Fl_Multi_Label assignment and
correct memory handling.

The new methods
 - Fl_Menu_Item::image_label(const Fl_Image *) and
 - Fl_Menu_Item::multi_label(const Fl_Multi_Label *)
provide a cleaner interface to assign images and Fl_Multi_Label's
to menu items.

examples/howto-menu-with-images.cxx: carify some issues, fix leak,
  and use new Fl_Menu_Item::multi_label(const Fl_Multi_Label *).
2023-12-23 20:08:18 +01:00
ManoloFLTK
f59702e290 A more cross-platform way to fix issue #876 2023-12-22 09:16:48 +01:00
Albrecht Schlosser
76a2c95f07 Fix a typo, trailing whitespace, and dependencies 2023-12-21 14:03:04 +01:00
Albrecht Schlosser
5df5daf78e Make the 'Forms' compatibility library 'fltk_forms' optional
This library is no longer needed in FLTK itself. There is only one
demo program (test/forms.cxx) that uses it if it is built. The demo
program displays a message if fltk_forms is not available.

The default is 'enabled' for backwards compatibility but this may
be changed to 'disabled' in a future version.
2023-12-20 17:33:37 +01:00
ManoloFLTK
bc5d7e77aa Remove typos in the documentation of fl_x11_use_display() 2023-12-19 19:36:07 +01:00
ManoloFLTK
96bacd3f9d Procedure to instruct FLTK to use given X11 connexion (#149) 2023-12-19 15:48:26 +01:00
Matthias Melcher
41dd84016d #862: Removes default shortcut from Fl_Shortcut_Button
- the current UI for fallback/default/original shortcut was
confusing, so I remove it until we find something better. I
kept the values so we can reinstate a better interface without
changing the API.
2023-12-13 16:55:16 +01:00
Albrecht Schlosser
3c6fed2dd7 Improve Fl_Tabs documentation (minor wording issue) 2023-12-13 16:11:16 +01:00
Matthias Melcher
c10183379f #188: Fixes Fl_Shared_Image ref count and find op
- ported froward from 1.3.9
- fixes ref count for original and other images
- fixes binary search issues
2023-12-12 22:44:49 +01:00
ManoloFLTK
28c7c584fa Improve documentation of fl_strdup()
and add example of value of fl_mac_os_version.
2023-12-12 11:58:00 +01:00
Greg Ercolano
3fb9bae040 Fl_Grid: Added show_grid(1) screenshot 2023-12-09 08:20:31 -08:00
Greg Ercolano
2571f20111 Solve issue 856: manolo's parameter names 2023-12-06 12:14:45 -08:00
Matthias Melcher
7a69c22bd7 #856: FLUID: improved Declaration dialog
Also makes enum comment in Fl_File_Chooser.fl manageable.
Not backward compatible: don't try to recreate the
File Chooser with older FLUID versions.
2023-12-05 17:54:13 +01:00
ManoloFLTK
3e61ec7044 New member function Fl_Image_Surface::mask(Fl_RGB_Image*) 2023-12-04 12:34:44 +01:00
Greg Ercolano
b9ac6bd728 Solves issue #856: improve Fl_File_Chooser enum docs 2023-12-03 18:10:33 -08:00
Albrecht Schlosser
9950c8e082 Improve contrast of check marks and radio buttons (#443)
- add fl_draw_radio(...) to standardize radio button drawing
- src/Fl_Light_Button.cxx: use fl_contrast() to determine color of
  radio button and check (light) button check marks, and use
  new fl_draw_radio() method
- src/Fl_Menu.cxx: same as src/Fl_Light_Button.cxx and use
  fl_draw_check() instead of "manually" drawing the check mark
  (forgotten in an earlier update)
2023-12-02 19:34:29 +01:00
Greg Ercolano
38aff7d9b4 solve issue 853: make scrollbar public 2023-11-29 08:29:24 -08:00
Albrecht Schlosser
727bd94560 Add commandline conversion for Windows (no-op on other platforms)
- add Fl::args_to_utf8() to convert commandline arguments to UTF-8

This new function closes the gap that previously only Visual Studio
applications converted their commandlines to UTF-8.

Tested with MinGW, MSYS2/MinGW-w64, and Visual Studio (2019).
2023-11-29 16:29:54 +01:00
ManoloFLTK
44b845cc42 Change type of member variables Fl_Graphics_Driver::ascent + descent
Type short is too small for Fl_Cairo_Graphics_Driver and font sizes ≥ 110.
2023-11-29 10:03:14 +01:00
Albrecht Schlosser
57371365d8 Fix compiler warning, dependencies, and trailing whitespace
The benign warning was:
  ‘Fl_Browser_::hscrollbar’ will be initialized after [-Wreorder]
  ‘int Fl_Browser_::linespacing_’ ...
2023-11-27 15:33:53 +01:00
ManoloFLTK
f6d2ba651b Cairo graphics driver: Improve drawing of Fl_Pixmap and Fl_Bitmap 2023-11-27 10:02:59 +01:00
Matthias Melcher
6817e821af STR 1373: adds vsync control to OpenGL contexts on macOS
Windows and X11 to follow, no idea about Wayland.
2023-11-26 12:37:59 +01:00
Matthias Melcher
39a3212fc3 Adds pulldown menu to Fl_Text_Display and ..._Editor 2023-11-25 22:52:00 +01:00
Matthias Melcher
c097f63ff8 Cleans up Fl_Input right mouse button menu 2023-11-25 22:08:05 +01:00
Matthias Melcher
7bef4ebf78 STR 749: Adds cut/copy/paste popup menu to Fl_Input 2023-11-25 21:42:27 +01:00
Matthias Melcher
34ed30fe1a Adds linespacing() to Fl_Browser_ and all derived widgets 2023-11-25 18:20:08 +01:00
Greg Ercolano
0080850092 Fl_Terminal better name for flags -> charflags 2023-11-25 06:56:38 -08:00
Matthias Melcher
b6be421a1f Added safety when calling Text_Display methods
- before assigning a buffer (Github #845)
- also fixed a warning form unused arg in Fl_Terminal
2023-11-23 15:16:34 +01:00
Greg Ercolano
9894812644 Make new handle_lf/cr methods private 2023-11-22 06:34:24 -08:00
Matthias Melcher
81e26b9089 Adding size range settings to Fl_Tile, initial commit.
- some documentation missing
- Fl_Tile::resize() not satisfying yet
- minimums work, maximums currently ignored
- 0 size children may make program hang
2023-11-22 14:45:13 +01:00
Greg Ercolano
9383f172a8 Fl_Terminal docs: Added some tables 2023-11-21 14:41:15 -08:00
Greg Ercolano
c568056244 Added output_translate(): controls lf -> crlf translation 2023-11-21 11:24:27 -08:00
Greg Ercolano
56e85e8522 Fl_Terminal docs for fg/bg colors 2023-11-21 09:06:46 -08:00
Greg Ercolano
6252131017 Solve issue 837, doc some protected methods. 2023-11-20 09:26:40 -08:00
Greg Ercolano
bc8b186398 Doc all pub/prot members, remove unused, add todo
- Made sure all public+protected members are documented.

- Reclassified some private -> protected:
   > vscroll_width()

- Removed signatures for unimplemented (non-existant) methods:
   > u8c_cursor(void)
   > history_use(int,bool)
   > cursor_h()

- Reclassified some protected -> private:
   > x_to_glob_col()
   > xy_to_glob_rowcol()
   > is_hist_ring_row()
   > is_disp_ring_row()
   > handle_ctrl()
   > is_printable()
   > is_ctrl()
   ..etc..
   > handle_selection_autoscroll()
   > handle_selection()
   > is_redraw_style

- Add todo for ESC 7 and ESC 8
- Small code formatting mods
- Small typos
2023-11-19 22:46:04 -08:00
Albrecht Schlosser
a72eff7588 Fix compiler warnings in Fl_Terminal on Windows
- missing FL_EXPORT: Visual Studio (dll)
- missing include <stdarg.h>: MinGW
2023-11-19 17:58:57 +01:00
Albrecht Schlosser
367d302b5f Apply two patches provided by user 'Andre' via mail
1. add missing FL_EXPORT to class Fl_Terminal
2. add missing test/wizard demo to test/Makefile
2023-11-17 19:27:00 +01:00
Albrecht Schlosser
44bb080c0f Remove friend declaration from Fl_Window.H (see STR 3354)
Although this was not strictly necessary I decided to implement the
proposed patch, but in a slightly different way.

This adds a static public method for internal use only but it wouldn't
do any harm if a user called it.
2023-11-17 16:55:37 +01:00
Albrecht Schlosser
6f7e1f4fb7 Enhance documentation of event processing 2023-11-17 15:25:21 +01:00
Greg Ercolano
38fc08c15f Added clear(), some methods protected->public
New public methods:

    void clear(void);
    void clear(Fl_Color val);

old protected methods made public:

    void clear_screen(bool scroll_to_hist=true);      // ESC [ 2 J
    void clear_screen_home(bool scroll_to_hist=true); // ESC [ H ESC [ 2 J
    void cursor_home(void);                           // ESC [ 0 H

test/terminal modified to test these, and added separate tests
for both the API and ANSI code ways to do these ops.
2023-11-16 15:45:29 -08:00
Matthias Melcher
d1d38090fb Fixes return type of Fl_Input_::dvalue() 2023-11-15 22:45:20 +01:00
Greg Ercolano
605328e045 Added textcolor() and color(), doc fixes.
textcolor() needed for consistency, color() behavior documented.

Both added to the test/terminal app.

Elaborated on the special background "see through" color value + behavior,
tested with color() in test/terminal app.
2023-11-14 12:23:23 -08:00
Albrecht Schlosser
4b315d190c Fix dependencies and whitespace issues 2023-11-14 18:14:48 +01:00
erco77
6842a43a31
Fl_Terminal widget (#800)
Pull Fl_Terminal widget from Greg's fork
2023-11-14 07:01:52 -08:00
Albrecht Schlosser
d32de2fc14 Fix missing FL_EXPORT of class Fl_Grid
Thanks to Andre for finding this and sending a patch via mail.
2023-11-12 19:23:53 +01:00
Matthias Melcher
d7768b76d0 FLUID: Adds template for tutorial.
Tutorial still to be written.
Also adds convenience methods to Fl_Input_
for getting and setting numeric values.
2023-11-07 14:28:22 +01:00
Matthias Melcher
e690e76da1 FLUID: Adds undo for all grid operations. 2023-11-05 22:19:03 +01:00
Matthias Melcher
1f5472a7d3 FLUID: Adds transient cells to Fl_Grid
This allows multiple widgets to occupy a single cell which is
needed when moving cells across the grid interactively.
2023-11-05 20:04:49 +01:00
ManoloFLTK
0ae927a00e Add Fl_Window::maximize() and Fl_Window::un_maximize() 2023-11-05 19:42:55 +01:00
ManoloFLTK
994f5d058b Fix: Fl::clipboard_contains() cannot query selection buffer (#690) 2023-11-01 10:41:51 +01:00
ManoloFLTK
bcc6de5332 Improve the documentation of class Fl_Display_device 2023-10-31 19:07:31 +01:00
ManoloFLTK
ded4018b89 Member Fl_Widget_Surface::draw_decorated_window() needs not be virtual 2023-10-31 18:33:31 +01:00
Matthias Melcher
17baeceb7a FLUID: Positioning grid cells intuitively.
User can now drag widgets from the toolbox into the grid
or use the context menu to add them into the corresponding
cell. If no position is indicated, now children are added at the
first free cell.
2023-10-23 01:36:55 +02:00
Matthias Melcher
d573bfe799 FLUID: Adds grid child positioning via +/- keys 2023-10-23 00:44:26 +02:00
Matthias Melcher
6cc3eb32db Removes Fl_String from documentation as well. 2023-10-22 23:10:06 +02:00
Albrecht Schlosser
1209e9dcd7 Make Fl_String and Fl_Int_Vector private (#789)
- add CMake option 'OPTION_USE_STD'
- add configure option '--enable-use_std'
- move FL/Fl_String.H to src/Fl_String.H
- move FL/Fl_Int_Vector.H to src/Fl_Int_Vector.H
- remove Fl_String from demo program examples/callbacks.cxx
- remove Fl_Int_Vector from public header FL/Fl_Table.H
- some methods of Fl_Table are no longer inline
- add CMake option OPTION_USE_STD to allow std::string in some
  selected functions and methods

Experimental, may be removed before release:

- use either Fl_Int_Vector or std::vector in Fl_Table depending
  on CMake OPTION_USE_STD or configure --enable-use_std

Move all fl_filename* functions that use Fl_String to fluid

Main changes in fluid:
 - add fluid_filename.h and .cxx
 - include "fluid_filename.h" rather than <FL/filename.H>

Update fl_input(), fl_password() and test/ask

- add maxchar parameter to fl_input() and fl_password()
- fl_input_str() and fl_password_str() are optional and return
  std::string if enabled (FLTK_USE_STD)
2023-10-22 19:35:17 +02:00
Matthias Melcher
b4fd7037ac FLUID: more Fl_Grid settings 2023-10-22 01:51:53 +02:00
Matthias Melcher
bbf0ea664d Removes dependency on Fl_Preferences::get/set(.., Fl_String, ...) 2023-10-21 18:41:57 +02:00
Matthias Melcher
0c35212467 FLUID: grid becomes a bit more interactive 2023-10-21 17:45:40 +02:00
Matthias Melcher
f8d7ee6f5c FLUID: adding a subset of Fl_Grid child parameters. 2023-10-21 13:20:11 +02:00
Matthias Melcher
9817536cfd FLUID: basic Fl_Grid support
* no settings for children yet
* ne good interactive editing for children
2023-10-20 19:00:52 +02:00
ManoloFLTK
143a18ee11 Add "#define MAC_OS_VERSION_14_0 140000" to mac.H 2023-10-20 10:57:48 +02:00
Albrecht Schlosser
5c7ad00e07 Improve Fl_Grid example code
Add 'grid->end();' although it's redundant in this specific example.
2023-10-19 14:22:58 +02:00
Albrecht Schlosser
27a779b235 Fix trailing whitespace 2023-10-18 15:00:37 +02:00
Albrecht Schlosser
38871c5b31 Add Fl_Grid widget and test and demo programs
- FL/Fl_Grid.H: header file
- src/Fl_Grid.cxx: implementation

- examples/grid-simple.cxx: simple example program
- test/cube.cxx:            use Fl_Grid for layout
- test/grid_alignment.cxx:  test cell alignment and other functions
- test/grid_buttons.cxx:    demo program as discussed in fltk.general
- test/grid_login.cxx:      like test/flex_login.cxx but with Fl_Grid
- test/flex_login.cxx:      modified to match test/grid_login.cxx
2023-10-16 22:18:24 +02:00
ManoloFLTK
ae4ed35229 Add virtual void Fl_Graphics_Driver::draw_circle() 2023-10-16 20:53:55 +02:00
Albrecht Schlosser
6ba7b49baf Improve subclassing cababilities of Fl_Tile (STR 2791)
- remove static variables and functions
- make move_intersection() virtual
- add (protected) cursor access methods

These changes were inspired by STR 2791 where the user proposing an
enhancement was not able to subclass Fl_Tile properly. This commit
fixes the mentioned issues and enables subclassing without copying
internal code.
2023-10-16 13:33:40 +02:00
ManoloFLTK
52f5653545 Doxygen-only: warn when current color is changed
Also, remove the statement that rectangles are drawn with 1-pixel lines
which is wrong with HighDPI displays.
2023-10-16 11:24:17 +02:00
Albrecht Schlosser
01038e832a Fix trailing whitespace and dependencies 2023-10-13 19:08:30 +02:00
Matthias Melcher
b1321bb97e #748: Adds option to choose menu window boxtype
...independently from the menu button or menu bar boxtype
2023-10-13 12:49:26 +02:00
Matthias Melcher
c41b3a1a64
Fixes fl_filename_relative on Linux, Mac, and Windows (#787)
* fixed filename_relative for Linux
* Fixing fl_filename_relative for MSWindows.
* Update documentation
* Fixed docs.
* Fixes Linux and macOS builds
2023-10-11 23:26:36 +02:00
Albrecht Schlosser
1fd6f0dd3a Fix STR 3458: "GLUT compatibility mode segfaults"
... "when there's no current window".

Silently ignore GLUT function calls that need a current window if the
current window is NULL, return 0 from functions that return an 'int'.

Check if window is shown in Fl_X11_Gl_Window_Driver::swap_buffers().
This would issue "XRequest.nnn: GLXBadDrawable 0x0" on X11 otherwise.

Note: the chosen implementation to ignore GLUT calls silently appears
to be compatible with GLUT (3.7) whereas FreeGLUT 3.0 would issue error
messages and exit. The latter could be implemented as well but would
be much more work.
2023-10-07 17:14:11 +02:00
ManoloFLTK
f20e2188fd Change prototype to Fl::now(double offset = 0) - cont'd 2023-10-06 17:11:43 +02:00
ManoloFLTK
4d9805537b Change prototype to Fl::now(double offset = 0) 2023-10-06 16:23:08 +02:00
Matthias Melcher
144d7d3529 Adds Fl_Menu_::prev_mvalue() (#685) 2023-09-29 15:22:47 +02:00
Matthias Melcher
f3eae58c52 Draw parent window backdrop on Fl_Tabs (#718) 2023-09-29 14:12:39 +02:00
Matthias Melcher
71b8e77935
FLUID: adds greatly enhanced Shell Commands (#774)
The user can add an arbitrary number of highly configurable 
shell commands through the setting panel. The commands can
be saved as user preferences, inside the .fl file, or exported
to an external file. Shell scripts can be limited to individual 
platforms, can have shortcut keys, etc. .

* documentation will follow
* support to call `fltk-config` will follow
2023-09-26 16:01:03 +02:00
ManoloFLTK
75273c06c5 Add Fl_Timestamp Fl::distant_past()
Can be handy when Fl::seconds_since() is used early at program startup
2023-09-26 12:31:20 +02:00
Greg Ercolano
cee69943e5 Small FNFC doc clarification; "pilots" -> "presets" 2023-09-20 23:34:43 -07:00
ManoloFLTK
824818303c Restore Doxygen doc of fl_graphics_driver 2023-09-17 09:00:48 +02:00
Albrecht Schlosser
ede381c005 Fix Visual Studio shared library build
Todo: fluid-shared can't (yet) be built agains the shared fltk lib
  because of some linker errors. Needs investigation.

Note: fluid-shared is basically a test program to demonstrate linking
  against the shared FLTK libs but doesn't work yet using VS (MSVC).
  This is no problem for the functionality.
2023-09-12 23:18:46 +02:00
Albrecht Schlosser
a75024213f Fix doxygen "undocumented parameter" warnings
... and argument order in FL_INLINE_CALLBACK_2 macro
2023-09-07 12:01:43 +02:00
Matthias Melcher
5ef29202ed Fixes Fl_Tabs to be more robust.
No children in Fl_Tabs should no longer crash the draw
method. Also, drawing an Fl_Tabs with no children inside
is now defined and documented.
2023-09-06 17:02:13 +02:00
Matthias Melcher
6bb5a81cee Adds some convenience methods.
fl_filename_absolute can no generate a path using arbitrary source paths.
Fl_Menu_ adds find_item_with_user_data and find_item_with_argument
Fl_String adds find(string, start)
2023-09-05 14:45:57 +02:00
Albrecht Schlosser
b2a41e08c3 Introduce Fl_Flex::need_layout() to optimize layout calculation
This is intended to reduce layout calculation and resizing of child
widgets until necessary before the Fl_Flex widget and all its
children are drawn in Fl_Flex::draw().

With this commit users no longer need to call layout() to layout the
Fl_Flex widget and its children properly unless they change widget
sizes or show/hide children.
2023-09-04 16:16:42 +02:00
Matthias Melcher
5e8adebac2 Adds compact buttons feature to create keypads.
See test/buttons for an example.
2023-09-03 00:09:40 +02:00
Matthias Melcher
502fa72eb4 #718: Fixes drawing issues for Fl_Tabs
Tabs were drawn incorrectly when children's box was not FL_NO_BOX
Current solution is cleaned up and always redraws tabs area
without leaving breadcrumbs behind
2023-09-02 20:56:57 +02:00
ManoloFLTK
0caa2c99c2 Special (UTF-8) characters in PDF docs maybe not rendered correctly (#772)
Use an image to display the table of the detailed description of class
Fl_PostScript_File_Device in PDF format, and keep using a dynamic table
for the HTML format.

Replace use of the '⌘' character in file drawing.dox by text 'cmd'.
2023-08-31 12:51:16 +02:00
ManoloFLTK
2e88b5efd1 Remove Doxygen warnings in processing of class Fl_Tabs 2023-08-31 12:41:02 +02:00
Matthias Melcher
443ce62300 #718: Fixes Fl_Tabs overlapping calculations
This method should greatly improve the overlapping calculations.
Tested with super wide and super many tabs.
Also documented every method in the class.
2023-08-30 20:03:44 +02:00
Matthias Melcher
b5a1da9612 FLUID: minor fixes 2023-08-29 22:50:12 +02:00
Albrecht Schlosser
ad5e49464b Document some protected methods and variables of Fl_Tabs
Todo: There are more protected methods that should be documented,
particularly the virtual ones that might be overridden by subclasses.
2023-08-29 15:19:07 +02:00
Matthias Melcher
5da15de174 FLUID: simplified worker handling 2023-08-29 01:38:39 +02:00
Albrecht Schlosser
8dfb83d990 Add missing FL_EXPORT for Windows shared lib build 2023-08-26 17:24:20 +02:00
Matthias Melcher
92ac709b7e Adds safe versions of fl_filename_*, returning Fl_String 2023-08-26 16:48:28 +02:00
Matthias Melcher
94a75b012f Fixes a bunch of typos in comments. 2023-08-26 15:17:28 +02:00
ManoloFLTK
3384776f8e Improve handling of type Fl_Offscreen under Wayland
Type Fl_Offscreen is now to be cast to cairo_t*.
Also, make sure the dimensions of GL windows are
multiples of the screen scale factor.
2023-08-18 18:02:35 +02:00
ManoloFLTK
64f64835dd Fix typos in names of Doxygen items (#729) 2023-08-17 08:22:25 +02:00
Matthias Melcher
10d9010ed9
Improved, yet compatible, widget callback system using macros (#729)
* adds FL/fl_callback.macros.H
* adds FL_FUNCTION_CALLBACK_n(widget, function, [type, data])
* adds FL_METHOD_CALLBACK_n(widget, class, instance, method, [type, data])
* adds FL_INLINE_CALLBACK_n(widget, [type, name, data], callback_body)
* adds `examples/callback`
* full documentation
2023-08-15 11:36:58 +02:00
Matthias Melcher
5e484524c8 Fl_Tabs now supports horizontal mouse wheel events. 2023-08-13 14:32:41 +02:00
ManoloFLTK
1943fe54c8 Wayland: fix fl_read_image() from offscreen buffer 2023-08-09 10:31:36 +02:00
ManoloFLTK
27c3d0b780 Wayland: improve layout of struct fl_wld_draw_buffer 2023-08-08 16:08:53 +02:00
Albrecht Schlosser
5bcd6ca8f2 Revert "#733 partial: Adds rotation gesture event on MacOS"
This reverts commit 3049e6394a
as agreed upon in GitHub Issue #733.
2023-08-05 16:37:38 +02:00
Matthias Melcher
3049e6394a #733 partial: Adds rotation gesture event on MacOS 2023-08-05 12:19:42 +02:00
Matthias Melcher
ee4ab86c3c #211: adds optional parameter for Fl_Input_::drawtext()
Does not change the original API but adds a function and
keeps the original automatic.
2023-08-03 17:35:27 +02:00
Matthias Melcher
f0375d6213 Adds default shortcut to Fl_Shortcut_Button. 2023-07-22 15:30:17 +02:00
Albrecht Schlosser
069a6b430b Enable compilation with VS 2022 and clang (#752)
Ensure that <stdint.h> is included in Visual Studio 2010 and later
(_MSC_VER >= 1600).
2023-07-19 14:25:14 +02:00
Matthias Melcher
f8ebde4da4 Documentation: screenshot updates 2023-07-14 18:10:17 +02:00
ManoloFLTK
f8d0b591ab Documentation: correct spelling errors 2023-07-14 18:00:34 +02:00
ManoloFLTK
d9df40f99d Documentation: details about how to position a window in screens 2023-07-13 18:22:59 +02:00
ManoloFLTK
c47cbf4402 More detailed documentation of Fl::screen_xywh() 2023-07-10 09:18:26 +02:00
ManoloFLTK
4d2d3cf76d Documentation: explain how to refresh GUI while printing 2023-07-09 12:59:54 +02:00
ManoloFLTK
89454508a2 Fix Fl_Simple_Terminal::append(str, len) assumes a null terminated string (#728) 2023-05-19 18:57:18 +02:00
ZJUGKC
385cabf3aa
Add const qualifiers to can_undo and can_redo (#720) 2023-04-17 16:12:03 +02:00
Albrecht Schlosser
c3560a8b02 Fix compiler warning [-Wunused-parameter] 2023-04-15 20:05:12 +02:00
Matthias Melcher
e18b5353cd Fixed leak in Fl_Text_Buffer #716 2023-04-14 16:54:11 +02:00
Matthias Melcher
afd3fde5de Memory leak in Input_ #716 2023-04-14 16:32:36 +02:00
Albrecht Schlosser
7b2c770ef7 Fix trailing comma in enums of public headers
Compiler warning: comma at end of enumerator list [-Wpedantic]

Note 1: I decided to fix these warnings although trailing commas in
enums are allowed at least since C++11.

Note 2: I fixed only public headers because these headers may be
compiled in user code. To do: check internal headers.
2023-04-13 20:14:36 +02:00
Albrecht Schlosser
9d380f24bd Fix misplaced 'const' [-Wignored-qualifiers]
warning: type qualifiers ignored on function return type
2023-04-13 19:58:26 +02:00
Albrecht Schlosser
c9ea7380d2 Fix compiler warning if user code is compiled with '-Wextra' (2)
Replace '(void*)' cast with '(fl_intptr_t)' because older gcc (4.8.2)
issues a warning with '(void*)'.
2023-04-13 18:56:59 +02:00
ManoloFLTK
caaa11a96f Standardize API to "graphics context" across platforms
Rename fl_wl_cairo() to fl_wl_gc()
Add function cairo_t* fl_cairo_gc() under OPTION_USE_CAIRO
2023-04-13 10:02:40 +02:00
Albrecht Schlosser
7d8195140c Add public accessor methods Fl_Widget::needs_keyboard()
- add public getter and setter for
- document the new methods
- document that these methods are not yet used internally
- remove unnecessary friend declaration 'NEEDS_KEYBOARD' flag
- simplify Fl::focus(Fl_Widget *) using the new methods.
2023-04-11 16:38:24 +02:00
Albrecht Schlosser
8639c43e3a Fix compiler warning if user code is compiled with '-Wextra'
This commit fixes two similar warnings:

"cast between incompatible function types from ‘void (*)(Fl_Widget*)’
 to ‘void (*)(Fl_Widget*, void*)’ [-Wcast-function-type]"
2023-04-11 15:10:07 +02:00
ManoloFLTK
f3423d3e83 More accurate documentation of function fl_wl_cairo() 2023-03-25 14:51:57 +01:00
Albrecht Schlosser
aebf2fec39 Improve Fl_Cairo_Window documentation (typos + indentation)
Also fix a doxygen warning in Fl_String.
2023-03-23 13:26:14 +01:00
Matthias Melcher
5c482f9d9b
Fix and update alignment #346 (#701)
* interactive layout alignment rewritten
* interface for new alignment rules
* new alignment dialog box
* user defined layout rules added
* layout rules can be stored in projects, settings, and external files
* Valgrind verification
2023-03-18 17:33:27 +01:00
Rob McDonald
09b7b4719d Protect GL_SILENCE_DEPRECATION from re-definition. 2023-03-15 23:15:32 +01:00
Albrecht Schlosser
0f41797b7a Cairo: introduce Fl::cairo_flush() in FLTK API
Flushing the Cairo context is necessary on Windows to make Cairo
drawings appear on the device (screen). This new method makes it easy
for user code to do this correctly after using Cairo drawings.

- add Fl::cairo_flush(cairo_t *)
- document Fl::cairo_flush(cairo_t *)
- reformat Cairo doxygen docs and code (partially)
- use the new method in Fl_Cairo_Window
- use the new method in test/cairo_test.cxx
- other minor (text) changes in test/cairo_test.cxx
- add test/cairo_test to the demo menu (test/demo.menu)
2023-03-14 19:51:34 +01:00
ManoloFLTK
eeb9267e6e Wayland: add support for multiple high or low DPI displays 2023-03-13 10:38:28 +01:00
Albrecht Schlosser
0f3b5ded8f Fix dependencies, typos, trailing whitespace, and formatting
No code changes.
2023-03-09 18:28:37 +01:00
ManoloFLTK
e18ce5400f Remove Doxygen warning about incorrect #include directive 2023-03-09 18:16:45 +01:00
ManoloFLTK
a624290b27 Remove warnings when fl_attr.h is compiled in C 2023-03-09 18:10:38 +01:00
Albrecht Schlosser
5175192755 CMake: build shared libs with OPTION_CAIROEXT (issue #250)
- remove separate libfltk_cairo to avoid cyclic dependencies, but
- keep a dummy libfltk_cairo in 1.4.0 for backwards compatibility
- move cairo/Fl_Cairo.cxx to src/Fl_Cairo.cxx
- add preliminary Cairo support for Visual Studio (MSVC)

Static linking is not affected by this change, but users building
with hand-made Makefiles will have to remove libfltk_cairo starting
with FLTK 1.4.0. The dummy library can be linked for backwards
compatibility but it will be removed later (in 1.4.x or 1.5.0).

The shared FLTK library libfltk.{so|dylib|dll|..} depends on libcairo
if and only if FLTK is built with one of the Cairo options. This has
always been the case for OPTION_CAIROEXT but is now also true if only
OPTION_CAIRO is selected, i.e. FLTK programs linked with a Cairo
enabled shared FLTK library will also be linked with libcairo. The same
is true for configure options --enable-cairo and --enable-cairoext,
respectively.

Preliminary Cairo support for MSVC now detects a Cairo installation
using the CMake variable FLTK_CAIRO_DIR which must be set by the user.
Note that this feature is temporary and may be changed in the future
for a better and more comfortable version.
2023-03-09 17:34:05 +01:00
Albrecht Schlosser
2626962dd3 Fix regression: failed to build shared FLTK libs
Add FL_EXPORT to some classes to make building shared libs possible.
Building shared libs and 'fluid-shared' missed global symbols.
2023-03-01 17:24:03 +01:00
Matthias Melcher
13cd927ab4
Add Fl_String to Fl_Preferences (#687) 2023-02-25 22:44:39 +01:00
Matthias Melcher
9f87af8ad9
Fl_String refactoring and extension (#683)
- add true unittest and Fl_String testing
- interface and printout are similar to gtest
  without requiring external linkage.
  just run `unittest --core`.
- new Fl_String API
- extended API to fl_input_str and fl_password_str
- co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2023-02-23 15:42:05 +01:00
Matthias Melcher
2971625418 Add GLUT_ELAPSED_TIME simulation 2023-02-20 13:40:27 +01:00
Matthias Melcher
6fbfaba19d
Move class Fl_Shortcut_Button from FLUID to core (#677) (#680) 2023-02-15 15:24:25 +01:00
Matthias Melcher
7f87c847ba
Unlimited undo/redo for Fl_Input_ and Fl_Text_Buffer (#558) (#676) 2023-02-10 17:13:20 +01:00
Matthias Melcher
4440e35693 Deprecated warnings wording adapted 2023-02-10 16:29:14 +01:00
Matthias Melcher
fc9d0a23af Fixes FL_DEPRECATED for Fl_Text_Buffer.h 2023-02-10 16:29:14 +01:00
Albrecht Schlosser
2239ecc4a1 Fix typos in documentation and comments
(no code changes)
2023-02-10 13:13:36 +01:00
Matthias Melcher
ffadc23cab
Expose elapsed time API (#670) 2023-02-09 14:48:39 +01:00
Albrecht Schlosser
9f8b65a70e Document MSVC macro _MSVC_LANG for future use in fl_attr.h
This macro defines the C++ standard used by the compiler since
Visual Studio 2015 Update 3.
2023-02-06 23:03:45 +01:00
ManoloFLTK
d4251d8b73 Fix "\todo Description of box types is incomplete" from Enumerations.H 2023-02-06 16:15:22 +01:00