FLTK 1.4.0
Loading...
Searching...
No Matches
Fl_Copy_Surface.H
1//
2// Copy-to-clipboard code for the Fast Light Tool Kit (FLTK).
3//
4// Copyright 1998-2023 by Bill Spitzak and others.
5//
6// This library is free software. Distribution and use rights are outlined in
7// the file "COPYING" which should have been included with this file. If this
8// file is missing or damaged, see the license at:
9//
10// https://www.fltk.org/COPYING.php
11//
12// Please see the following page on how to report bugs and issues:
13//
14// https://www.fltk.org/bugs.php
15//
16
17#ifndef Fl_Copy_Surface_H
18#define Fl_Copy_Surface_H
19
20#include <FL/Fl_Widget_Surface.H>
21
49class FL_EXPORT Fl_Copy_Surface : public Fl_Widget_Surface {
50private:
51 class Fl_Copy_Surface_Driver *platform_surface;
52protected:
53 void translate(int x, int y) FL_OVERRIDE;
55public:
56 Fl_Copy_Surface(int w, int h);
61 int w();
63 int h();
64 void origin(int *x, int *y) FL_OVERRIDE;
65 void origin(int x, int y) FL_OVERRIDE;
66 int printable_rect(int *w, int *h) FL_OVERRIDE;
67};
68
69
84class Fl_Copy_Surface_Driver : public Fl_Widget_Surface {
85 friend class Fl_Copy_Surface;
86protected:
87 int width;
88 int height;
89 Fl_Copy_Surface_Driver(int w, int h) : Fl_Widget_Surface(NULL), width(w), height(h) {}
90 virtual ~Fl_Copy_Surface_Driver() {}
91 void set_current() FL_OVERRIDE = 0;
92 void translate(int x, int y) FL_OVERRIDE = 0;
93 void untranslate() FL_OVERRIDE = 0;
94 int printable_rect(int *w, int *h) FL_OVERRIDE;
99 static Fl_Copy_Surface_Driver *newCopySurfaceDriver(int w, int h);
100};
101
107#endif // Fl_Copy_Surface_H
Supports copying of graphical data to the clipboard.
Definition Fl_Copy_Surface.H:49
virtual bool is_current()
Is this surface the current drawing surface?
Definition Fl_Device.cxx:92
virtual void set_current(void)
Make this surface the current drawing surface.
Definition Fl_Device.cxx:80
A surface on which any FLTK widget can be drawn.
Definition Fl_Widget_Surface.H:25
virtual int printable_rect(int *w, int *h)
Computes the width and height of the drawable area of the drawing surface.
Definition Fl_Widget_Surface.cxx:190
virtual void origin(int x, int y)
Sets the position of the origin of graphics in the drawable part of the drawing surface.
Definition Fl_Widget_Surface.cxx:145
virtual void untranslate()
Undoes the effect of a previous translate() call.
Definition Fl_Widget_Surface.cxx:121
virtual void translate(int x, int y)
Translates the current graphics origin accounting for the current rotation.
Definition Fl_Widget_Surface.cxx:114
#define FL_OVERRIDE
This macro makes it safe to use the C++11 keyword override with older compilers.
Definition fl_attr.h:46