Rename Fl_wayland.cxx to fl_wayland_clipboard_dnd.cxx

This commit is contained in:
ManoloFLTK 2022-03-05 12:28:21 +01:00
parent f5ad1d2545
commit c2c7795614
5 changed files with 24 additions and 31 deletions

View File

@ -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

View File

@ -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

View File

@ -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();

View File

@ -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;
}

View File

@ -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
@ -32,30 +32,6 @@
# include <errno.h>
////////////////////////////////////////////////////////////////
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;