Commit Graph

2238 Commits

Author SHA1 Message Date
Albrecht Schlosser
114dbc9c81 Clarify documentation of Fl_Image::copy() and more (#431)
- emphasize that Fl_Image::copy(W, H) creates an image with
  w() == data_w() == W and h() == data_h() == H
- clarify some more docs of Fl_Image methods (ensure that data_w()
  and data_h() are used where appropriate rather than w() and h()
- improve wording, examples, and formatting of related docs.

Closes #431
2022-04-15 02:01:33 +02:00
ManoloFLTK
d83d89679b Fix for issue #429 : Segfault with Ctrl+/- with current git version 2022-04-14 11:07:56 +02:00
Albrecht Schlosser
10537b7143 Make Fl_Image::copy() 'const', including all derived classes
Copying an image does not (and must not) change the original object,
hence copy() should always be 'const'.

This is *necessary* if the given Fl_Image object is 'const'.
2022-04-13 16:50:30 +02:00
ManoloFLTK
95b5623b96 Fix for issue #427 - continued. 2022-04-13 11:13:05 +02:00
ManoloFLTK
bfae813c4e Fix for issue #427: Problems with data_w, data_h, w, h of Fl_Image. 2022-04-12 15:06:21 +02:00
ManoloFLTK
04305ec7e3 Add note to doc of Fl_Cairo_Window about required build option. 2022-04-07 17:21:23 +02:00
ManoloFLTK
ee5b9974bb Update doc of struct Fl_Menu_Item whose shortcut_ member is now an int. 2022-04-07 12:12:20 +02: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
e91d65cd2f Fix whitespace errors (no code changes) 2022-03-31 16:00:11 +02:00
ManoloFLTK
d9a6ec88e4 Add support of Fl_Region to the Cairo graphics driver
and remove it from the Wayland graphics driver.
2022-03-31 10:36:01 +02:00
Albrecht Schlosser
a638f5a545 Add method Fl_Shared_Image::image()
This public method returns a pointer to the internal Fl_Image
object (const Fl_Image *). This is only for reference, the internal
image must not be modified by user code but it can be inspected and
copied to another image.
2022-03-30 15:56:27 +02:00
ManoloFLTK
dc8c4b5676 Wayland: replace public fl_event_time by static wld_event_time. 2022-03-27 09:20:30 +02:00
YX
e9b1c2fed0 Add const to Fl_Image::fail() (PR #415) 2022-03-26 17:55:13 +01:00
Albrecht Schlosser
fc250a3aa2 Update documentation and dependencies 2022-03-25 17:27:46 +01:00
ManoloFLTK
427e4dbc7a Remove platform-dependent type Fl_Bitmask (not in documented public API). 2022-03-24 10:00:01 +01:00
ManoloFLTK
2d71a95b5d Wayland: replace global fl_display by function struct wl_display *fl_wl_display(). 2022-03-23 11:37:25 +01:00
ManoloFLTK
d87b62ea69 Avoid using same name (p) for distinct members of derived classes. 2022-03-21 15:56:50 +01:00
ManoloFLTK
bf5b902180 Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing. 2022-03-21 14:39:00 +01:00
ManoloFLTK
a9412b41bb Issue #359 RFE: access the MacOS windowid . 2022-03-21 11:41:51 +01:00
Albrecht Schlosser
4bcd5c467b Improve documentation of Fl_Image::copy()
Mention the new Fl_Image::release() method to delete all types of
images.
2022-03-20 15:52:08 +01:00
ManoloFLTK
9d869d73c1 Begin documenting the Wayland platform, new in FLTK version 1.4 2022-03-10 15:05:26 +01:00
Albrecht Schlosser
53b40f4138 Improve documentation on Fl_Menu_Item's and related methods (#332)
See discussion on GitHub Issue #332.

Summary: don't change FLTK code but document what to do and not to do.
2022-03-07 18:28:32 +01:00
ManoloFLTK
3718effc43 Add the Wayland platform to FLTK 1.4 2022-03-04 15:41:00 +01:00
Albrecht Schlosser
a773fdc44b Fix whitespace, update dependencies and fluid files 2022-03-03 17:20:24 +01:00
Albrecht Schlosser
091712bea8 Fix default size_range() calculation (issue #392, STR 3352) 2022-03-01 13:45:51 +01:00
Albrecht Schlosser
cdd1933661 X11: Disable "boxcheat" hack
For details see comment in src/Fl_x.cxx: this "Hack to speed up
bg box drawing" is now disabled for several reasons. The code
is still available if the macro ENABLE_BOXCHEAT is defined.
2022-02-22 19:55:11 +01:00
Albrecht Schlosser
84c06419bc Remove obsolete/disabled "boxcheat" code
Windows platform: Remove comments about obsolete code and one
exported declaration of the variable 'fl_background_pixel' which
is used only on the X11 platform.

X11 platform: Remove comments.

Other platforms: not affected.
2022-02-21 20:38:33 +01:00
Kevin Routley
2de8f8579c
DOC: Provide a link to the "FLTK Standard Box Types" image (#397)
* Provide a link to the "FLTK standard box types" image

The doc for Box Types has the text "see figure 1" which does not exist! [It is figure 5.3 in PDF, no number in HTML].

This change provides a hyperlink which allows the reader to actually navigate to the cited figure.

Confirmed to work as desired in HTML; I don't have LATEX so cannot confirm the PDF.

* Add figure title "Standard Box Types" (#397)

Co-authored-by: Albrecht Schlosser <albrechts.fltk@online.de>
2022-02-21 16:42:08 +01:00
Kevin Routley
f196ffbb52
Fix documentation error in Fl_Tabs (#391) 2022-02-13 12:40:48 +01:00
silverduner
52bfbbc2fa
expose position(int, int), x(), y(), w() and h() from Fl_File_Chooser (#80)
* expose position(int, int), x(), y(), w() and h() from Fl_File_Chooser for positioning

* exposed size() and resize() in Fl_File_Chooser.
2022-02-12 20:46:12 +01:00
ManoloFLTK
bf16e4e8aa More detailed doc of Fl_Window::decorated_h() for X11 platform. 2022-02-08 08:03:35 +01:00
ManoloFLTK
53605ba055 Add note about use of Fl_Window::decorated_h() under the X11 platform. 2022-02-07 19:14:09 +01:00
Matthias Melcher
db0a1f4bae
OpenGL implementation of all fl_ "Drawing Fast Shapes" graphics calls (#385)
* Fix build system for unites,

* Updated unittest to check OpenGL drawing.

Making sure that OpenGL drawing is exactly the same
as native drawing to make FLTK widget rendering
look the same in GL windows.

* Make OpenGL optional.

* Implemented clipping in OpenGL

* unites drawing fast shapes

* Fixed CMake

* Updating unittest.

Added tests for fl_pi and fl_arc (int)
Renamed tab to render complex shapes.

* Improved OpenGL FLTK drawing emulation.

* Fixed GTK ROUND DOWN BOX

* Fixing Makefile for unittest

* Correctly aligning OpenGL text.

* Fixed text alignment in GL windows.

Explained the "FLTK over GL " example in Cube.

* Overlapping test.

* Better GL graphics alignment.

* Drawing the focus rect.

* Adding Alpha Channel support for GL.

* Added FLTK-on-GL documentation.
2022-02-06 15:22:24 +01:00
Albrecht Schlosser
c483c4c5de Fl_Preferences (X11): Fix detection of preferences directory
- Fix compiler warning [-Wmaybe-uninitialized] for variable home
- Reformat enum 'Root' for better readability
- Add new enum values CORE_SYSTEM_L and CORE_USER_L
- Improve documentation (deprecated and new enums)
- Initialize internal static variable 'filename' which could be used
  uninitialized and thus return any previous value (type == MEMORY)
2022-02-03 20:46:13 +01:00
ManoloFLTK
895ac51c69 macOS: add "Toggle printing of titlebar" to application menu - cont'd. 2022-02-02 11:19:09 +01:00
ManoloFLTK
935074ba0b macOS: add "Toggle printing of titlebar" to application menu. 2022-02-02 11:05:53 +01:00
Albrecht Schlosser
29d9e31c51
Consolidate timeout handling across platforms (#379)
Add Fl_Timeout class

Move platform independent code of Fl::wait() to main part

- basic timeout handling
- Fl::run_checks()
- Fl::run_idle()
- Fl::idle()
- waiting time calculation (next timeout)
- remove platform dependent "screen driver" stuff
2022-01-31 22:27:17 +01:00
Matthias Melcher
cf4a832e6a
Adding Text_Display color variables. (#384) 2022-01-30 22:14:40 +01:00
Matthias Melcher
cdb51045dd
Background color attribute for Fl_Text_Display. (#378)
* Background color attribute for Fl_Text_Display.

* Adding attributes.

* Avoid clipping horizontal

* Fl_Text_Display underlining.

* Better line positions

* Typos, testing.

* Documentation.
2022-01-27 23:50:06 +01:00
Matthias Melcher
7308bcdb74
Preferences XDG path (#377)
* Preferences: remove CamelCase from public interface.

* Prefs: documentation.

* Prefs: updating Doxygen comments

* XDG conforming preferences path
2022-01-23 22:35:21 +01:00
Albrecht Schlosser
04ccc8cc46 Remove experimental platforms Android, Pico, SDL (PR #376)
... as discussed in fltk.coredev: "FLTK 1.4.0 release schedule"
https://groups.google.com/g/fltkcoredev/c/PDbHTRpXVh0/m/JqboexZ_AwAJ
2022-01-23 18:12:47 +01:00
Matthias Melcher
09eff7243a
Fixing and upgrading Fl_Preferences (#374)
* Added filename function to Fl_Preferences

Static function to get filename before opening.
Member to get filename after opening.
Bug fixes for memory mapped preferences.

* ERROR is a macro on Windows, don't use it

* Added Fl_Preferences::dirty().

User can now check if the database will be written
when flushed or destroyed.
Flush returns a crude error code.

* Fl_Preferences::get binary data returns # of bytes read.

* Verified group deletion code

* Fl_Preferences ignores locale.

This will make .prefs files interchangeable
between different computers.

* Updating the Preferences Mode to ignore locale.

* Fixes in docs.
2022-01-19 16:08:29 +01:00
Greg Ercolano
196430b016 Issue #358 cont'd: Fl_Cairo_Window coord system docs
Elaborated on Fl_Cairo_Window's use of FLTK style coordinates,
    and how this differs from cairo's default native normalized
    coordinate system, and shows how to switch from one to the other.

    Also, small comment fix to the cairo example regarding the "X" color.
2022-01-16 16:59:49 -08:00
Albrecht Schlosser
788ca208f7 Rename FL/Fl_String_class.H to FL/Fl_String.H
This is part 2 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
Albrecht Schlosser
92e9181a0a Rename FL/fl_string.h to FL/fl_string_functions.h
This is part 1 of the final fix for a previous name clash on case
insensitive file systems (fl_string.h vs. Fl_String.H).
2022-01-16 19:47:16 +01:00
Albrecht Schlosser
ab58971bcf Improve focus box drawing and documentation
Add new method
  Fl_Widget::draw_focus(Fl_Boxtype t, int x, int y, int w, int h, Fl_Color bg)

  ... with background color for correct contrast testing (in Fl_Tabs)

Draw the focus box of the "tabs" of Fl_Tabs widgets with the correct
  boxtype and background color.

Make 'unsigned int visible_focus()' const so it can be used in 'const'
  methods.

Do not draw the focus box if the per-widget focus box option is off.
2022-01-14 17:17:09 +01:00
Greg Ercolano
9c55ad4273 Fixes #362 2022-01-13 15:26:27 -08:00
Greg Ercolano
47cd9a11a0 Fixes issue #361. 2022-01-13 07:28:00 -08:00
Albrecht Schlosser
879da686b6 Fix typo in Fl_Menu_Item docs 2022-01-13 14:20:55 +01:00
ManoloFLTK
5bab46940c Re-organize cross-platform support for text input methods.
FLTK 1.3 supports complex text input methods (TIMs) for the 3 platforms
(X11, Windows, macOS). This support has an interface with FLTK that is
common for X11 and Windows, via (undocumented) functions fl_set_spot(),
fl_set_status() and fl_reset_spot().
In contrast, and because it's been developed independently, the
interface between the macOS TIM and FLTK 1.3 is completely different :
static functions FL::insertion_point_location() and Fl::reset_marked_text().

The present change implements a single TIM/FLTK interface
used by all platforms based on functions fl_set_spot() and
fl_reset_spot().

The previous macOS-specific functions FL::insertion_point_location() and
Fl::reset_marked_text() are maintained only for compatibility with 1.3
and deprecated.
2022-01-07 16:34:54 +01:00