Commit Graph

345 Commits

Author SHA1 Message Date
Manolo Gouy
5bb4e853c7 Remove Fl_Image_Surface::end_current() to be called after usage of the drawing surface.
This ensures API compatibility with FLTK 1.3 where Fl_Surface_Device->set_current()
is used to change the current drawing surface.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.4@12125 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-30 07:09:48 +00:00
Manolo Gouy
c530cdeda6 Use Fl_Graphics_Driver::default_driver() when convenient.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12088 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-11-09 09:49:48 +00:00
Albrecht Schlosser
e3670dfda6 Fix inconsistent interpretation of ld() in image handling (STR #3308).
Documentation has been fixed and clarified, and ld() handling is now
consistent in Fl_(RGB_)Image, their subclasses and fl_draw_image()
and similar functions.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@12029 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-10-14 16:35:52 +00:00
Manolo Gouy
eabbc41ef1 Avoid compilation warnings with -Wmaybe-uninitialized
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11993 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-29 13:28:40 +00:00
Manolo Gouy
827fa250f3 Remove fl_wait() that is not part of the public API.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11953 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-20 12:58:51 +00:00
Manolo Gouy
c06374378f Remove fl_ready() not in public API and mostly same as Fl_XXX_Screen_Driver::ready()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11951 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-19 16:59:59 +00:00
Manolo Gouy
c5960df5fb Rewrite fl_open_callback() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11929 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-09 15:56:33 +00:00
Albrecht Schlosser
9fd31ed94e Fix buffer overflow in CR/LF conversion.
An already present CR/LF combination causes us to jump two characters,
but we failed to update the length counter when doing this.

This also makes sure we handle the corner case of a CR as the last
character.

Note: porting Pierre Ossman's commit (svn r11873) to branch-1.3-porting.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11913 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-09-01 10:35:21 +00:00
Manolo Gouy
0e404ab7d7 Fix slight mis-scaling when pasting Enhanced metafile from clipboard
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11904 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-28 15:37:45 +00:00
Manolo Gouy
87d28f5eab Use desktop scaling factor also when pasting an Enhanced Metafile
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11900 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-28 06:45:59 +00:00
Manolo Gouy
5dbfe413ae Fix computation of Fl_Window::decorated_w() and decorated_h() when apps are resized through display setting.
Under Windows 10:
when the user sets the value of "Change the size of text, apps and other items" in display settings
to above 100 %, the computation of Fl_Window::decorated_w() and decorated_h() has to
take the scaling factor into account.
This factor is also necessary to draw correctly window title bars.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11893 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-25 12:42:50 +00:00
Manolo Gouy
a7ce881c7d Remove unused variable.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11892 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-24 08:57:21 +00:00
Manolo Gouy
0267781cec Change return type of Fl_Screen_Driver::read_win_rectangle() to Fl_RGB_Image*
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11884 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-08-23 09:38:46 +00:00
Manolo Gouy
5ec684f236 Minor simplification.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11678 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-22 17:13:40 +00:00
Manolo Gouy
163c65dc6f Avoid the expression "foreign language" in comments.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11676 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-20 07:19:19 +00:00
Matthias Melcher
769d151a12 Virtualized add_fd and remove_fd into System Driver
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11668 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 22:45:22 +00:00
Manolo Gouy
cd4498021e Have headers x.H, win32.H and mac.H share a unique definition of class Fl_X
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11667 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 20:47:25 +00:00
Manolo Gouy
1e8a53ecc4 Move private_dc from Fl_X for WIN32 platform to Fl_WinAPI_Window_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11664 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 19:37:49 +00:00
Manolo Gouy
4aa388d4ff Add static Fl_XXX_Window_Driver *driver(Fl_Window*) to get the platform-specific driver of a window.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11663 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 17:34:15 +00:00
Manolo Gouy
24487a719f Move Fl_X::make_fullscreen() for WIN32 platform to Fl_WinAPI_Window_Driver:: make_fullscreen().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11660 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 15:47:23 +00:00
Manolo Gouy
1e060f6408 Transform Fl_X::make(Fl_Window*) for WIN32 platform into virtual Fl_X* Fl_Window_Driver::makeWindow().
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11659 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-19 15:33:58 +00:00
Manolo Gouy
c0f14ca2f0 Move other_xid member variable from class Fl_X to class F_Window_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11654 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-18 17:02:44 +00:00
Manolo Gouy
e790ac9653 Move wait_for_expose member variable from class Fl_X to class Fl_Window_Driver.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11653 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-18 16:11:15 +00:00
Manolo Gouy
0629b40afd Move set_cursor() member functions from class Fl_X to classes Fl_Window_Driver and derived.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11652 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-18 14:31:07 +00:00
Manolo Gouy
cb95d40067 Remove Fl_X::setwindow(Fl_Window*) from WIN32 and USE_X11 Fl_X classes.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11649 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-18 12:48:40 +00:00
Manolo Gouy
85b5f02a8b Replace member function void Fl_X::flush() by virtual void Fl_Window_Driver::flush()
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11646 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-18 11:58:46 +00:00
Matthias Melcher
e2495a760a MSWindows fixes for previous commits.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11644 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17 17:45:44 +00:00
Matthias Melcher
cc57af841a virtualizes fl_set_spot and fl_reset_spot
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11640 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17 14:22:02 +00:00
Manolo Gouy
c6c92e4037 Remove set_icons() from the virtual API of class Fl_Window_Driver because it is internal to some drivers.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11636 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-17 05:41:05 +00:00
Manolo Gouy
c4953935b0 Continue removing non window-related member-functions from class Fl_X.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11633 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-16 13:15:49 +00:00
Manolo Gouy
b0ce80f56b Continue removing non window-related member-functions from class Fl_X.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11632 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-16 12:28:50 +00:00
Manolo Gouy
2fcb4f4192 Move platform-dependent implementations of fl_open/close_display() to the Fl_Screen_Driver class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11619 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 15:36:10 +00:00
Manolo Gouy
15715cd898 Move platform-dependent implementations of Fl::en/dis/able_im() to the Fl_Screen_Driver class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11618 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 15:12:22 +00:00
Manolo Gouy
397a3b83bf Move platform-dependent implementations of fl_clipboard_notify_changes() to the Fl_System_Driver class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11617 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 15:01:27 +00:00
Manolo Gouy
b1f8f3e2aa Move platform-dependent implementations of Fl::clipboard_contains() to the Fl_System_Driver class
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11616 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 14:49:46 +00:00
Manolo Gouy
d683841f9f Move the platform-dependent implementations of Fl::paste() to the Fl_System_Driver class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11615 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 14:32:13 +00:00
Manolo Gouy
7508a033c5 Continue moving to Fl_System_Driver the platform_dependent implementations of member functions of the Fl class.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11614 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-15 14:18:37 +00:00
Albrecht Schlosser
aafd8b6031 Fix VisualC++ build (Visual Studio 2015).
IDE generated with CMake, still many warnings, but compiles and runs.

Note: we *must* get rid of all VisualStudio-specific #define's like:

 #define unlink _unlink

This one led to a compilation error (not a warning).

src/Fl_File_Icon.cxx: I had to add _MSC_VER (WIN32) distinction as in
  previous code (FLTK 1.3). Obviously MinGW is more Unixy than MS VC++
  since MinGW compiled and linked the code. Needs a better fix ...


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11580 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-11 00:46:11 +00:00
Manolo Gouy
6879d54fc4 Rewrite Fl_lock.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11578 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-10 20:38:04 +00:00
Albrecht Schlosser
020a96b4a8 Fix more compiler warnings.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11536 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-05 21:15:45 +00:00
Manolo Gouy
b3af5591ca Stop using fl_read_image() to read window decoration.
Use instead an API internal to each platform code base.
fl_read_image() is used only for its documented feature
of reading inside the current window or an offscreen buffer.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11518 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-03 08:36:19 +00:00
Manolo Gouy
d011d5b4f0 Replace src/Fl_Font.H by one file for each platform.
This file contained nearly only platform-specific code.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11507 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-04-02 13:22:48 +00:00
Manolo Gouy
d67f395031 Rewrite functions XRectangleRegion(), XDestroyRegion() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11479 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-30 20:16:40 +00:00
Manolo Gouy
4fcefc68f8 Remove the platform-dependent type xchar
File fl_utf8.h defines the xchar type with a platform-dependent value (wchar_t or unsigned short).
But it is used exclusively by WIN32 code (0 use in cross-platform code, 0 use in APPLE
or in USE_X11 code).
Thus, we can just get rid of this type and replace it by wchar_t where it is used.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11459 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-29 09:29:51 +00:00
Manolo Gouy
915d6c643a Isolate the definition of the 3 public, OS-dependent types (Fl_Offscreen, Fl_Region, Fl_Bitmask).
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11432 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-26 14:36:11 +00:00
Manolo Gouy
8e14321df4 Remove duplicate #include directive
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11421 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-25 15:39:51 +00:00
Manolo Gouy
a69133d317 Separating platform-dependent from platform-independent code: make src/Fl.cxx cross-platform.
File src/Fl_win32.cxx is now compiled instead of included in Fl.cxx.

git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11420 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-25 13:08:48 +00:00
Manolo Gouy
1778ee8831 Fix the implementation of Fl_Window::default_icons(const Fl_RGB_Image *icons[], int count) under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11417 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-24 06:19:10 +00:00
Albrecht Schlosser
4a31fd7aed Provide Fl_Window_Driver accessor methods for public Fl_Window attributes.
These methods are intended to be used instead of pWindow->method()
for better code readability and easier porting of methods from
Fl_Window to Fl_Window_Driver.

New methods: x(), y(), y(), h(), shown(), parent(), border(),
  visible(), and visible_r().

We should add more such methods if appropriate.


git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11414 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-24 01:20:08 +00:00
Manolo Gouy
fdaad858ba Rewrite Fl_Window::iconize() under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11411 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
2016-03-23 18:00:37 +00:00