Commit Graph

377 Commits

Author SHA1 Message Date
Albrecht Schlosser
42c27da735 Reformat, remove unnecessary code, add comments 2022-07-01 17:39:41 +02:00
ManoloFLTK
02870242ee Move input method support to Fl_Screen_Driver from Fl_Graphics_Driver 2022-06-19 10:23:24 +02:00
ManoloFLTK
bf5b902180 Rename member Fl_Graphics_Driver::p to xpoint to avoid shadowing. 2022-03-21 14:39:00 +01:00
ManoloFLTK
49dae86edf Fix for issue #418 : some warnings about unused functions. 2022-03-21 12:12:07 +01:00
Albrecht Schlosser
5ebb76050b Fix size_range() - continued (issue #392)
- fix window size of GL windows as reported for test/glpuzzle.cxx
- fix window not resizing on ctrl/+/- (X11 only)

Unfortunately the previous commit "optimized" a necessary X11 message
away. This is now fixed.

Fixes #392.
2022-03-05 15:50:49 +01:00
ManoloFLTK
3718effc43 Add the Wayland platform to FLTK 1.4 2022-03-04 15:41:00 +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
Albrecht Schlosser
e73f9d466d Rearrange "Print Button Window" functions
- Rename Fl_Screen_Driver::print_or_copy_window() to
    fl_print_or_copy_window()
- Add header file src/print_button.h
- Update dependencies
2022-02-03 21:57:47 +01:00
ManoloFLTK
2e6e0b9c36 Reorganize classes Fl_System_Driver and Fl_Screen_Driver
These virtual members are moved from Fl_Screen_Driver to Fl_System_Driver
- wait(double)
- ready()

These virtual members are moved from Fl_System_Driver to Fl_Screen_Driver
- copy(const char *stuff, int len, int clipboard, const char *type)
- void paste(Fl_Widget &widget, int clipboard, const char *type)
- clipboard_contains(const char *type)
- clipboard_notify_change()

These members are moved from Fl_X11_Screen_Driver to Fl_X11_System_Driver
- poll_or_select_with_delay(double time_to_wait)
- poll_or_select()
and are made virtual in preparation for the introduction of class
Fl_Unix_System_Driver.
2022-02-03 07:03:44 +01:00
ManoloFLTK
9a2b3ef798 Input Method support: have the auxiliary window follow when the focus window is moved. 2022-01-08 17:08:39 +01:00
ManoloFLTK
27c175dad8 Add virtual void Fl_Graphics_Driver::set_status() and implement for X11 platform. 2022-01-07 07:50:36 +01:00
Greg Ercolano
74dd5164d3 Fixes STR #3352: "tiny window problem if child group larger than window" 2021-12-05 12:26:25 -08:00
ManoloFLTK
84cf249482 Fix for issue #253: Remove xdbe support 2021-11-26 15:01:54 +01:00
Albrecht Schlosser
1ce3a84e9f Refactor and improve "Print front window" dialog
src/print_button.cxx: "Print front window" implementation (new file)

This is compiled and activated if USE_PRINT_BUTTON is defined.

The feature can be fine controlled by environment variable
  'FLTK_PRINT_BUTTON' (see docs in source file).
2021-11-19 18:50:53 +01:00
Albrecht Schlosser
a0654b59ac Fix X11 build with FLTK_CONSOLIDATE_MOTION turned off 2021-11-05 13:12:52 +01:00
Albrecht Schlosser
0ad192a27b Make "FLTK_CONSOLIDATE_MOTION" user-definable (issue #76)
This undocumented macro is used on X11 and macOS platforms to
consolidate mouse move events, i.e. to collect some events and send
them later as one event. The old macro name CONSOLIDATE_MOTION has been
renamed to FLTK_CONSOLIDATE_MOTION since it is now a "global" symbol.

Users can define FLTK_CONSOLIDATE_MOTION in their build system, e.g.
on the compiler commandline, as 0 or 1 to disable or enable this
feature, respectively.

In FLTK 1.3 the default was 0 (OFF) on macOS and 1 (ON) on X11.
In FLTK 1.4 the default is always 0 (OFF).
2021-11-05 12:46:21 +01: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
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
Albrecht Schlosser
ff0543524b Fix X11 copy-paste and drag-and-drop target selection (#182)
Select the "best" target rather than a random one out of a list of
suitable targets. The old target selection algorithm would sometimes
select the wrong target and hence retrieve unexpected data.

This could happen in both copy-paste and drag-and-drop operations.

Note: backported to 1.3.6 (git current) as well
      (commit 7ce6d2cf5d).

Closes #182.
2021-02-11 15:51:37 +01:00
ManoloFLTK
d7985607d6 Fix for issue #123 - X11 platform
As discussed, only the window position becomes rounded to nearest integer value
when a fractional GUI scale factor is applied.
2020-11-25 09:21:44 +01:00
ManoloFLTK
a47c907fca Fix for STR #3424 and for issue #160 2020-11-22 10:16:21 +01:00
ManoloFLTK
bfb64aa01e Remove the "Print" window meant for debugging. 2020-10-28 17:34:05 +01:00
ManoloFLTK
8accc6e840
Pango ps (#148)
Use cairo-PostScript to output PostScript when pango is available.

This allows to draw in vectorial form any script.
Before, only the Latin script could be drawn to PostScript in vectorial form.
2020-10-28 17:19:05 +01:00
ManoloFLTK
0c55cd1aca Create Fl_X11_System_Driver::dlopen_or_dlsym() for run-time addresses.
The intent is to gather in a single place of the X11 platform source code
all variable elements when using dlopen() and dlsym() system functions
(e.g., .so vs .dylib extension name, is RTLD_DEFAULT available, locations
to be sought).
Member function Fl_System_Driver::load() is created only to support
Fl_Plugin_Manager::load().
2020-10-04 08:21:07 +02: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
ManoloFLTK
7f7e0e4ea1 Replace Fl_Window_Driver::is_a_rescale() by Fl_Window::is_a_rescale()
so it can be called by any user code.
2020-05-08 17:08:33 +02:00
Albrecht Schlosser
924289a40c X11: Fix X Input Methods (XIM) (STR 3502, 3192)
Revert commit 958d912ffc using 'XSetLocaleModifiers("@im=");'
which was incorrect (STR 3192).

Apply fix for STR 3502, using 'XSetLocaleModifiers("");' which appears
to be the correct solution for using X Input Methods (XIM).

This has also been backported to FLTK 1.3.6 in branch-1.3, see
commit 219ae5e455.
2020-02-10 13:38:26 +01:00
darealshinji
71dc3269cd Eliminate -Wunknown-pragmas and -Wsign-compare warnings on GCC 2020-02-09 15:31:57 +01:00
Albrecht Schlosser
b8ab77e39c Don't "export" X11 specific fl_open_display() function
The X11 specific overloaded function fl_open_display(Display *)
has never been documented but exposed (and "exported" in the ABI)
in FL/platform.H which is not necessary. This internal function
is now static and no longer exposed in the ABI.

Don't confuse with fl_open_display() w/o arguments which is still
exported and declared in FL/platform.H.
2020-02-03 15:58:13 +01:00
Albrecht Schlosser
a9bdb7a7b4 Fix disabling of deprecated warnings
Fix cut'n'paste error: needs #pragma pop instead of push.
2020-01-31 15:54:51 +01:00
Albrecht Schlosser
65a798f9a2 Disable X11 "deprecated declaration" warning
... for GCC >= 4.6 and clang compilers.

This annoying warning exists on X11 (Linux/Unix/macOS) platforms
because we need to use XKeycodeToKeysym() although it is deprecated.
See STR 2913 for discussion and details.
2020-01-31 15:06:21 +01:00
ManoloFLTK
2f64c6a861 Concentrate source code that supports Darwin + XQuartz + fink as test platform 2019-10-30 17:25:49 +01:00
ManoloFLTK
f20c07d757 X11: support copy/paste of image via clipboard within a single app
X11 requires to process differently paste if both copy and paste are within the
same app or are in 2 separate apps. This was implemented for paste of text.
It's now also implemented for paste of image.
2019-07-18 17:46:10 +02:00
ManoloFLTK
499ec5c291 Replace static void Fl_Window_Driver::default_icons() by virtual Fl_Screen_Driver::default_icons() 2019-03-25 18:47:29 +01:00
ManoloFLTK
8e9512330d X11 platform: keep GUI scaling after screen is reconfigured 2019-03-11 16:38:35 +01:00
ManoloFLTK
4e2ba8c888 X11 platform: follow when the OS changes the Xft.dpi resource
Under gnome, Tweaks -> Fonts ->Scaling factor allows to change
the size of all fonts handled by gnome.
With that change, FLTK apps obey to changes to Xft.dpi.
2019-03-11 16:20:29 +01:00
ManoloFLTK
5f6efb741d Improve static function react_to_screen_reconfiguration() 2019-03-06 14:59:47 +01:00
ManoloFLTK
d988930461 Process env var FLTK_SCALING_FACTOR consistently across platforms.
The procedure to set screen scaling factors becomes:
1) each screen scaling factor is set to 1
2) the OS is queried according to each platform to get screen scaling factor
values
3) The value of FLTK_SCALING_FACTOR, if present, is used to multiply
scaling factors
2019-03-06 11:10:37 +01:00
ManoloFLTK
21c0134931 New member function const Fl_Image* Fl_Window::shape() replaces int Fl_Window::is_shaped()
The new function allows to get the window's shaping image
and delete it after use, if appropriate.
2019-02-23 10:21:27 +01:00
ManoloFLTK
2c12bf4e1a X11 platform: account for window scaling in drag-n-drop operations. 2019-02-09 16:28:26 +01:00
Manolo Gouy
b6f65b1c87 X11: simplify the use of member function Fl_X11_Screen_Driver::init_workarea().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13044 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-09-07 09:24:35 +00:00
Manolo Gouy
643bb3bbbb Remove private member variable Fl_X11_Window_Driver::current_cursor_ that's no longer used.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@13003 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-08-03 18:20:37 +00:00
Manolo Gouy
7ebe8e21b0 Move Fl_Window_Driver.H from FL/ to src/
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12974 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-26 13:43:18 +00:00
Manolo Gouy
bfac49015c Fix for STR#3475: X11 platform, re-use current screen scaling factor when processing a screen reconfiguration event.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12939 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-06-08 11:31:30 +00:00
Manolo Gouy
8b7f7c78b2 Remove public member function Fl_Window_Driver *Fl_Window::driver() so class Fl_Window_Driver is not in FLTK public API.
This function is replaced by static Fl_Window_Driver* Fl_Window_Driver::(const Fl_Window *win).
The purpose is to have class Fl_Window_Driver outside from FLTK ABI.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12915 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-12 09:36:36 +00:00
Manolo Gouy
2b7aac129b Rename Fl_Paged_Device::start_job() to begin_job() and Fl_Paged_Device::start_page() to begin_page().
The new function names begin_job() and begin_page() better match end_job() and end_page() with which
they must be used by pair.
The old names start_job() and start_page() are maintained for API compatibility with FLTK 1.3.x

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12910 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-05-09 14:16:35 +00:00
Albrecht Schlosser
42d8aba117 Replace FL/x.H with FL/platform.H - step 2 (STR #3435).
This second step replaces FL/x.H with FL/platform.H in all source files.
Dependencies have been adjusted as well.

This commit completes the replacement of FL/x.H with FL/platform.H.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12641 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2018-01-31 21:17:17 +00:00