diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-05 12:28:21 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-03-05 12:28:21 +0100 |
| commit | c2c77956145e7cacb9a3c18ca019ff316f56fa03 (patch) | |
| tree | 3ede17a00e613a37ac5749785dfeccb842aa4b46 /src | |
| parent | f5ad1d25458681907cdb6f05008fe3ea4e06c0db (diff) | |
Rename Fl_wayland.cxx to fl_wayland_clipboard_dnd.cxx
Diffstat (limited to 'src')
| -rw-r--r-- | src/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/Makefile | 2 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.H | 6 | ||||
| -rw-r--r-- | src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx | 17 | ||||
| -rw-r--r-- | src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx (renamed from src/drivers/Wayland/Fl_wayland.cxx) | 28 |
5 files changed, 24 insertions, 31 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0d3e05be4..7d3b9a59d 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -254,7 +254,7 @@ elseif (OPTION_USE_WAYLAND) drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx - drivers/Wayland/Fl_wayland.cxx + drivers/Wayland/fl_wayland_clipboard_dnd.cxx drivers/Cairo/Fl_Cairo_Graphics_Driver.cxx Fl_Native_File_Chooser_FLTK.cxx Fl_Native_File_Chooser_GTK.cxx diff --git a/src/Makefile b/src/Makefile index 457aa4b59..dab3f75bb 100644 --- a/src/Makefile +++ b/src/Makefile @@ -289,7 +289,7 @@ WLCPPFILES = \ drivers/Wayland/Fl_Wayland_Image_Surface_Driver.cxx \ drivers/Wayland/Fl_Wayland_Copy_Surface_Driver.cxx \ drivers/Wayland/Fl_Wayland_Graphics_Driver.cxx \ - drivers/Wayland/Fl_wayland.cxx + drivers/Wayland/fl_wayland_clipboard_dnd.cxx # fl_dnd_x.cxx Fl_Native_File_Chooser_GTK.cxx diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H index ce10884c5..0ce25734f 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.H @@ -150,11 +150,11 @@ public: virtual int has_marked_text() const; static int next_marked_length; // next length of marked text after current marked text will have been replaced // --- clipboard operations - // this one is in Fl_wayland.cxx + // this one is in fl_wayland_clipboard_dnd.cxx virtual void copy(const char *stuff, int len, int clipboard, const char *type); - // this one is in Fl_wayland.cxx + // this one is in fl_wayland_clipboard_dnd.cxx virtual void paste(Fl_Widget &receiver, int clipboard, const char *type); - // this one is in Fl_wayland.cxx + // this one is in fl_wayland_clipboard_dnd.cxx virtual int clipboard_contains(const char *type); // --- Wayland-special void set_cursor(); diff --git a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx index 71a14ca22..84b2c8c91 100644 --- a/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx +++ b/src/drivers/Wayland/Fl_Wayland_Screen_Driver.cxx @@ -1426,3 +1426,20 @@ char *Fl_Wayland_Screen_Driver::get_seat_name() { struct xkb_keymap *Fl_Wayland_Screen_Driver::get_xkb_keymap() { return seat->xkb_keymap; } + + +int Fl_Wayland_Screen_Driver::get_mouse_unscaled(int &mx, int &my) { + open_display(); + mx = Fl::e_x_root; my = Fl::e_y_root; + int screen = screen_num_unscaled(mx, my); + return screen >= 0 ? screen : 0; +} + + +int Fl_Wayland_Screen_Driver::get_mouse(int &xx, int &yy) { + int snum = get_mouse_unscaled(xx, yy); + float s = scale(snum); + xx = xx/s; + yy = yy/s; + return snum; +} diff --git a/src/drivers/Wayland/Fl_wayland.cxx b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx index f00a7d909..b6e921fc5 100644 --- a/src/drivers/Wayland/Fl_wayland.cxx +++ b/src/drivers/Wayland/fl_wayland_clipboard_dnd.cxx @@ -1,7 +1,7 @@ // -// Wayland specific code for the Fast Light Tool Kit (FLTK). +// Wayland-specific code for clipboard and drag-n-drop support. // -// Copyright 1998-2021 by Bill Spitzak and others. +// Copyright 1998-2022 by Bill Spitzak and others. // // This library is free software. Distribution and use rights are outlined in // the file "COPYING" which should have been included with this file. If this @@ -33,30 +33,6 @@ //////////////////////////////////////////////////////////////// - -Window fl_message_window = 0; -int fl_screen; -Window fl_xim_win = 0; -char fl_is_over_the_spot = 0; - - -int Fl_Wayland_Screen_Driver::get_mouse_unscaled(int &mx, int &my) { - open_display(); - mx = Fl::e_x_root; my = Fl::e_y_root; - int screen = screen_num_unscaled(mx, my); - return screen >= 0 ? screen : 0; -} - - -int Fl_Wayland_Screen_Driver::get_mouse(int &xx, int &yy) { - int snum = get_mouse_unscaled(xx, yy); - float s = scale(snum); - xx = xx/s; - yy = yy/s; - return snum; -} - -//////////////////////////////////////////////////////////////// // Code used for copy and paste and DnD into the program: //static Window fl_dnd_source_window; |
