diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-07 06:49:40 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-07 06:49:40 +0100 |
| commit | 37bf3835b0b3ce7f4c80924f40735698f057ef6f (patch) | |
| tree | 5862a10eef97cf3575bfe55b2f29fc5a79ae3270 /src/drivers/Unix/Fl_Unix_Screen_Driver.H | |
| parent | b663e272e7f39063a5c1bf744038ded0a7566990 (diff) | |
Create class Fl_Unix_Screen_Driver used by X11 and Wayland platforms
Diffstat (limited to 'src/drivers/Unix/Fl_Unix_Screen_Driver.H')
| -rw-r--r-- | src/drivers/Unix/Fl_Unix_Screen_Driver.H | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/drivers/Unix/Fl_Unix_Screen_Driver.H b/src/drivers/Unix/Fl_Unix_Screen_Driver.H new file mode 100644 index 000000000..ebd0ed706 --- /dev/null +++ b/src/drivers/Unix/Fl_Unix_Screen_Driver.H @@ -0,0 +1,61 @@ +// +// Definition of the part of the screen driver shared by X11 and Wayland platforms +// for the Fast Light Tool Kit (FLTK). +// +// Copyright 2021-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 +// file is missing or damaged, see the license at: +// +// https://www.fltk.org/COPYING.php +// +// Please see the following page on how to report bugs and issues: +// +// https://www.fltk.org/bugs.php +// + +#ifndef FL_UNIX_SCREEN_DRIVER_H +#define FL_UNIX_SCREEN_DRIVER_H + +#include "../../Fl_Screen_Driver.H" + +# if USE_POLL + +# include <poll.h> +static pollfd *pollfds = 0; + +# else +# if HAVE_SYS_SELECT_H +# include <sys/select.h> +# endif /* HAVE_SYS_SELECT_H */ + +// The following #define is only needed for HP-UX 9.x and earlier: +//#define select(a,b,c,d,e) select((a),(int *)(b),(int *)(c),(int *)(d),(e)) + +# define POLLIN 1 +# define POLLOUT 4 +# define POLLERR 8 + +# endif /* USE_POLL */ + + +class Fl_Unix_Screen_Driver : public Fl_Screen_Driver { +public: + static fd_set fdsets[3]; + static int maxfd; + static int nfds; + static struct FD { + # if !USE_POLL + int fd; + short events; + # endif + void (*cb)(int, void*); + void* arg; + } *fd; + virtual int poll_or_select_with_delay(double time_to_wait); + virtual int poll_or_select(); + virtual void *control_maximize_button(void *) { return NULL; } +}; + +#endif /* FL_UNIX_SCREEN_DRIVER_H */ |
